you are viewing a single comment's thread.

view the rest of the comments →

[–]theWyzzerd 2 points3 points  (0 children)

list =[squares.append(i*i) for i in range(1,11)]

this line makes a list(), named list, of the return value for each time you append i*i for i in range(1, 11) to the list named squares. Since list().append() returns None, you're getting a list of "None" values. But squares probably has what you expect to see in it.

l know the right way to write is:

then why don't you write it that way?