r/learnpython • • Mar 27 '23

Actually using a tuple

Can someone, please, give me a "real-world" example on the use of a tuple? I'm learning through w3schools. The idea of a tuple sort of makes sense, but I have no idea how it would/could be applied.

147 Upvotes

64 comments sorted by

View all comments

21

u/[deleted] Mar 27 '23 edited Mar 27 '23

Hmm how about a dictionary of resolution options? ['FHD':(1920, 1080), 'WUXGA':(1920, 1200)] etc I think that's a fairly good use of a tuple. You wouldnt want those to change.