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

Show parent comments

-16

u/teepidge Mar 27 '23

Dude. Too much. I feel like someone asking for a real world example or using a tuple can't follow this. I say that because that's me... Looking for a real world example and I can't follow this at all.

14

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 Mar 27 '23

Perhaps. You're welcome to try and give a simpler answer, my sleep-deprived brain couldn't come up with a better one on the spot.

-2

u/teepidge Mar 27 '23

No I mean I was hoping for a simpler answer because I struggle with the concept, too. I appreciate the depth, but I think in the learn python subreddit, the average user is more novice level, and your answer went above and beyond. I can see myself bookmarking it and returning to it when I have a better understanding of what you're talking about!

12

u/HelpfulBuilder Mar 27 '23

Well the real answer is that at your level there isn't much difference. I program with python almost every day and 99% of the time I could use either one.

He had this somewhat complicated example bc there aren't many examples.