More with 'for'


it says:Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: 'int' object has no attribute 'append' 
please help.
my code is:

start_list = [5, 3, 1, 2, 4]
square_list = []
  # Your code here!
for square_list in start_list:
print square_list


This is not good practice to name your for loop's instant variable after an already declared variable,

set it to any relevant word like for example,
for number in start_list:

and then remove this line that is outside the for loop,

lastly remember the instructions say to raise all value by the power of 2 so you would append to square list like,



wasnt that much off in my code, wanted to square the whole start_list, which works, when i would use numpy-modul like im used too from my computational physics course.

anyway your answer helped me!

thanks a lot!


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