Stuck at More with 'for' - help


just can't figure out what i have done wrong

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

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

print square_list


you need to define square_list above your for each loop like this:

square_list = []


needs to be



ohh thanks just understood it a lot more better now.


no problem, glad you got it


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