Why my code is not working


#1



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

Traceback (most recent call last):
File "python", line 7, in
AttributeError: 'NoneType' object has no attribute 'sort'

I don't now why it's not working .. can someone please help


Replace this line with your code. 
start_list = [5, 3, 1, 2, 4]
square_list = []

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

print square_list


#2

Remove that!

You should have:

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

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

Hope this helps! :smile:


#3

actually I tried this before and didn't work but now it worked ! hahaha thanks man


#4

You're welcome! How do you know if I'm a guy? :laughing: (Just kidding)

Have fun coding! :smile:


#5

I've got a question ... when I end up with the course of python what should I do next ? should I do some advance courses ? or like any suggested projects ? How can I like be more in this language ?


#6

Yup! You could go for advanced courses and maybe some frameworks.

Try sticking around on forums like here and also stackoverflow.


#7

If you're just looking for more practice with the language, I would use CodeWars. I also practice on HackerRank.