What is a tuple useful for?

后端 未结 11 800
天涯浪人
天涯浪人 2021-02-01 12:45

I am learning Python for a class now, and we just covered tuples as one of the data types. I read the Wikipedia page on it, but, I could not figure out where such a data type wo

11条回答
  •  猫巷女王i
    2021-02-01 13:24

    • Tuples are used whenever you want to return multiple results from a function.
    • Since they're immutable, they can be used as keys for a dictionary (lists can't).

提交回复
热议问题