Program on For loop and lists and list.sort() method