Program on For-loop,lists and Sorting of lists