r/learnpython • u/Pure-Homework681 • 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
11
u/jimtk IdontChat Mar 27 '23
Tuple are groups of simple data like list, but they are immutable (you can't change the values inside), smaller and faster.
When you read a record from an sqlite database (as an example) it is returned in a list of tuple.