Why do we need tuples in Python (or any immutable data type)?

后端 未结 9 1621
悲&欢浪女
悲&欢浪女 2020-11-30 17:19

I\'ve read several python tutorials (Dive Into Python, for one), and the language reference on Python.org - I don\'t see why the language needs tuples.

Tuples have n

9条回答
  •  再見小時候
    2020-11-30 17:54

    Sometimes we like to use objects as dictionary keys

    For what it's worth, tuples recently (2.6+) grew index() and count() methods

提交回复
热议问题