Help on 9. more with "for"


#1

please help me on this i don't know what i did wrong.

Oops, try again. It looks like square_list has 2 at index 1 instead of 4.

start_list = [5, 3, 1, 2, 4]
square_list = []
for numbers in start_list :
numbers ** 2
square_list.append(numbers)
square_list.sort()

print square_list


#2

start_list = [5, 3, 1, 2, 4]
square_list = []
for numbers in start_list :
    numbers = numbers ** 2 //you have to overwrite the current value of numbers with his square
    square_list.append(numbers)
square_list.sort()

print square_list

#3

hi marco:slight_smile:


#4

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