What is wrong with this code?


#1

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

Your code here!

for i in start_list:
square_list = start_list.append(i**2)

square_list.sort()

print square_list


9.more with "for"
#2

square_list will be None since list.append() does not return anything.

square_list.append(...)

#3

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