4 python 元祖

lists2 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for lists2on in lists2[:]:
    print(lists2on)

lists3 = lists2[:]  #复制列表
for lists3on in lists3:
    print(lists3on)

########元祖########

yz = ("a","b","c") #定义元祖

for yzon in yz:
    print(yzon)

yz = ("aa","bb","cc") #不能修改,只能重构赋值
print(yz)




发表评论

邮箱地址不会被公开。