DEV Community

Discussion on: Solve This Python Question

Collapse
 
madalinfasie profile image
madalinfasie

Aside from what the others have said, there is also no ++ operator in python.

The line for a[i] in a will work, but it has no point and looks awful and confusing.

You should add a note to point out that this code is a parody or something.

A nice change to the code would've been to write a = a.append(i). I found that many beginners confuse the return type of the append method.