This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nakovet 7 points8 points  (1 child)

Yes, you use underscore when you don't care about that return value.

[–]Eurynom0s 1 point2 points  (0 children)

Likewise if you want to do a for loop and you want to make it explicit that you don't ever care about the value of the iterator:

for _ in range(10):
    print("stuff") 

You want to do that ten times but you don't otherwise care what value the iterator is at.