教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 python中tuple指什么

python中tuple指什么

发布时间:2020-11-07   编辑:jiaochengji.com
教程集为您提供python中tuple指什么等资源,欢迎您收藏本站,我们将为您提供最新的python中tuple指什么资源

python中tuple指什么?

python中tuple指元组,Python的元组与列表类似,不同之处在于元组的元素不能修改。

元组使用小括号,列表使用方括号。

元组创建很简单,只需要在括号中添加元素,并使用逗号隔开即可。

如下实例:

实例(Python 2.0 )

tup1 = ('physics', 'chemistry', 1997, 2000)
tup2 = (1, 2, 3, 4, 5 )
tup3 = "a", "b", "c", "d"

推荐学习:《Python教程》

以上就是python中tuple指什么的详细内容,更多请关注教程集其它相关文章!

  • 本文原创发布教程集,转载请注明出处,感谢您的尊重!
  • 您可能感兴趣的文章:
    python中tuple指什么
    python中的tuple是什么
    python tuple什么意思
    python list和tuple的区别
    python tuple和list的区别是什么
    python中index的用法是什么
    python有什么数据类型
    Python中eval有什么用
    Python list()和tuple()函数用法
    Python有什么数据结构

    [关闭]
    ~ ~