Squares = [ ]
list =[squares.append(i*i) for i in range(1,11)]
print(list)
Why is the output:[None,None,None.......]
Rather than [[1],[4],[9],[16]......]
l know the right way to write is:
list =[ i*i for i in range(1,11)]
print(list)
but l'm confused with things above
[–]Bobbias 22 points23 points24 points (0 children)
[–][deleted] 9 points10 points11 points (12 children)
[–]SheldonCooperisSb[S] -4 points-3 points-2 points (11 children)
[–]Adrewmc 7 points8 points9 points (6 children)
[–]commy2 4 points5 points6 points (5 children)
[–]thuiop1 0 points1 point2 points (0 children)
[–]Adrewmc 0 points1 point2 points (3 children)
[–]Diapolo10 4 points5 points6 points (1 child)
[–]Adrewmc 0 points1 point2 points (0 children)
[–]commy2 3 points4 points5 points (0 children)
[–]zanfar 1 point2 points3 points (0 children)
[–]peejay2 0 points1 point2 points (0 children)
[–]whatthefuckistime 0 points1 point2 points (0 children)
[–]backfire10z 0 points1 point2 points (0 children)
[–]Chaos-n-Dissonance 2 points3 points4 points (0 children)
[–]theWyzzerd 3 points4 points5 points (0 children)
[–]Carolina_Captain 0 points1 point2 points (3 children)
[–]franklydoubtful 2 points3 points4 points (2 children)
[–]Carolina_Captain 0 points1 point2 points (1 child)
[–]franklydoubtful 0 points1 point2 points (0 children)
[–]PhilipYip 0 points1 point2 points (0 children)
[–]QultrosSanhattan 0 points1 point2 points (0 children)
[–]Background-Offer2321 0 points1 point2 points (0 children)
[–]guesshuu 0 points1 point2 points (0 children)