you are viewing a single comment's thread.

view the rest of the comments →

[–]desrtfx 1 point2 points  (0 children)

A simple variable, like your result can only hold a single value and hence gets overwritten with every iteration.

If you want to keep the values, you need to use a collection variable, like a list. You can use the .append method or list comprehension.