I'm on the "More with 'for'" section of 'Python List and Dictionaries' and I must say, the way codecademy explains some areas are rather poor and confusing.
It took me a while to under stand how to figure it out, but I have no idea how what I did fixed the problem.
The code I originally used was :
start_list = [5, 3, 1, 2, 4] square_list =  for number in start_list: start_list.append(number ** 2) start_list.sort() print square_list
What it should have been is :
start_list = [5, 3, 1, 2, 4] square_list =  for number in start_list: square_list.append(number ** 2) square_list.sort() print square_list
Can someone explain how using 'square_list.append(number **2) works when there is no information in square_list.
I gone back to previous lessons and to try and understand but codecademy doesn't really explain how this functions work.