Need help with 9. More with 'for'


#1

I don't know what is wrong with my code, please help me fix this.

start_list = [5, 3, 1, 2, 4]
square_list = []

for number in start_list:
    square_list = square_list.append(number ** 2)
    square_list.sort()
print square_list

the error:

 'NoneType' object has no attribute 'sort'

#2

try out the code below

square_list.append(number ** 2)

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.