More with 'for'


#1

Ok here is my code, but I keep receiving an error stating that square_list should be the same as start_list, here it goes:
start_list = [5, 3, 1, 2, 4]
square_list = []

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

print square_lists

P.S. I have the correct indentions


#2

You've kind of done this backwards, it wants you to take elements from start_list to square_list. Example:

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

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

print square_list

#3

@cadecodes Thank you so much, you were of great assistance. If I run into to any future problems, I'll be sure to contact you. Thanks again


#4

Yes, just let me know by adding @cadecodes in your post! Happy coding! :slightly_smiling:


#5

Thanks for the Help. I got it to work.


#6

Thanks this really helped! xD


#7