tuple = (
'abcd',
786,
2.23,
'runoob',
70.2)
tinytuple = (
123,
'runoob')
print(tuple)
print(tuple[
0])
print(tuple[
1:
3])
print(tuple[
2:])
print(tinytuple *
2)
print(tuple + tinytuple)
tup = (
1,
2,
3,
4,
5,
6)
print(tup[
0])
print(tup[
1:
5])
tup1 = ()
tup2 = (
20,)
转载于:https://www.cnblogs.com/bilaisheng/p/10210948.html