胶州网站建设平台,交换链接名词解释,上海猎头公司招聘信息,国外视频设计网站引言
一、元组的创建方式 #第一种:
t (python,No.1)
print(t)
print(type(t))
#第二种: 内置函数tuple()
t1 tuple((python,No.2))
print(t1)
print(type(t1))注#xff1a;当元组中只有一个元素时候#xff0c;需要加 逗号#xff01;#xff01;#xff01;#xff…引言
一、元组的创建方式 #第一种:
t (python,No.1)
print(t)
print(type(t))
#第二种: 内置函数tuple()
t1 tuple((python,No.2))
print(t1)
print(type(t1))注当元组中只有一个元素时候需要加 逗号
二、元组的遍历 for item in t1 :print(item)
for i in range(2) :print(t[i])