开发者社区> 问答> 正文

python中tuple是什么

python中tuple是什么

展开
收起
云计算小粉 2018-05-10 20:10:25 1843 0
2 条回答
写回答
取消 提交回答
  • 元组的关键字.

    (1,2,)

    2019-11-12 18:16:57
    赞同 展开评论 打赏
  • python中的tuple是一种数据类型,由多个成员组成,与list相比不同之处在于tuple的成员不能修改。 >>> a = (1, 2, 'string', None) >>> type(a) >>> a (1, 2, 'string', None) >>> a[1] 2 >>> a[1] = 0 Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment
    2019-07-17 22:20:39
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载