📜  在 python 代码示例中初始化一个元组

📅  最后修改于: 2022-03-11 14:45:18.533000             🧑  作者: Mango

代码示例1
#Initialising an empty tuple
my_tuple = ()
#OR
my_tuple = tuple()

#Initialising elements in a tuple
my_tuple = (1,) #Single element initialization
#OR
my_tuple = (1, 2) #Multi-element initialization
#OR
my_tuple = (1, 2, "Dog") #Multi-type initialization