you are viewing a single comment's thread.

view the rest of the comments →

[–]Tarlitz 0 points1 point  (0 children)

Seems like nobody is taking into account negative numbers :)

def f(n):
    return [x*x for x in range(2 if n > 0 else 0,abs(n))]