在Python代码中,()表示元组(tuple)。
my_tuple = (1, 2, 'a', 'b')
print(my_tuple[0]) # 输出:1
a, b, c, d = my_tuple # a=1, b=2, c='a', d='b'
my_tuple[0] = 3 # 报错:TypeError: 'tuple' object does not support item assignment
更多关于Python元组的信息,请参考腾讯云官方文档:https://cloud.tencent.com/document/product/215/3324
领取专属 10元无门槛券
手把手带您无忧上云