More with for - i don't get it


#1

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

Your code here!

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

print square_list


#2

here:

square_list.append((x ** 2)

look at how you use parentheses (how many)


#3

after deleting one paren the problem is gone ?


#4

I accidently moved on without perceiving what I did there


#5

i didn't see any further problems, did you solve it?

If problems persist, post an updated version of your code, and i will actually run it


#7

you use number in this loop, but under you wrote x**2 - square_list.append(number**2)


#8

I had a similar issue and solved it by correctly indenting the square_list.append(number**2) line


#9

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