# 元组中的元素不能被修改 # a_tuple = (1,2,3,4,5) # # print(a_tuple) # print(a_tuple[0]) # print(a_tuple[4]) # a_tuple = (5) 当元组中只有一个元素时,要加逗号,否则它就是int类型 # print(type(a_tuple)) # C:\Python\Python37\python.exe F:/program/python/lianxi/036_元组高级.py # <class 'int'> # # Process finished with exit code 0 # a_tuple = (5,) # print(type(a_tuple)) # C:\Python\Python37\python.exe F:/program/python/lianxi/036_元组高级.py # <class 'tuple'> # # Process finished with exit cod
元组~~~
最新推荐文章于 2024-01-29 14:54:05 发布