Getting error, please help! FIGURED OUT DONT NEED HELP ANYMORE


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/6?curriculum_id=4f89dab3d788890003000096#


Traceback (most recent call last):
File "python", line 6, in
AttributeError: 'int' object has no attribute 'append'


I don't know why the code isn't running.


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

# Your code here!
for list in start_list:
    list.append(list ** 2)
    square_list.sort()

print square_list


#2

Here!

You should be appending to square_list and not list

I hope this helps! :slight_smile:


#3

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