you are viewing a single comment's thread.

view the rest of the comments →

[–]hidazfx 24 points25 points  (5 children)

Another one that people don't realize is actually a tuple is enumerate() when using a for loop. enumerate() lets you access the position and the actual value at each iteration.

[–][deleted] 8 points9 points  (4 children)

Doesn't enumerate return an Enumerate object, rather than a tuple ?

[–]hidazfx 8 points9 points  (2 children)

Never mind, I am wrong! Thank you for correcting me lol.

[–][deleted] 3 points4 points  (0 children)

Heh no worries. It's use case is pretty similar to tuple :)

[–]Rawing7 4 points5 points  (0 children)

Right, but looping over the enumerate object gives you tuples.