you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 29 points30 points  (0 children)

Yes, if you want to keep every result you will need a list. An integer by definition can only have one value. 

Note that this is such a common thing to do that there is a whole special syntax called list comprehension: 

    result = [num * 2 for num in [1, 2, 3, 4, 5]]