Quick actions

cmd+k|ctrl+k

Navigation

Languages

Python 3 - 变量类型:3

Snippet info

Language

Python

Visibility

public

Author

fenghestudio

Created

2019-11-23T13:08:40Z

Updated

2019-11-23T13:08:40Z

#!/usr/bin/python3

tuple = ( 'abcd', 786 , 2.23, 'john', 70.2  )
tinytuple = (123, 'john')

print (tuple)           # 输出整个元素
print (tuple[0])        # 输出元组第一个元组
print (tuple[1:3])      # 输出第一个到三个元素。 
print (tuple[2:])       # 输出第二个到最后
print (tinytuple * 2)   # Prints tuple two times
print (tuple + tinytuple) # Prints concatenated tuple
INFO