定义: (int , bool, str, list, tuple, dict)
区别: 元组不可以进行修改
home = ("蔡文姬", "貂蝉", "甄宓 ")
# 访问:
print(home[0])
print(home[0: 2])
# 遍历
for i in home:
print(i)
# in not in index count
tp = ([1, 2, 3],)
tp[0].append(4)
print(tp)
定义: (int , bool, str, list, tuple, dict)
区别: 元组不可以进行修改
home = ("蔡文姬", "貂蝉", "甄宓 ")
# 访问:
print(home[0])
print(home[0: 2])
# 遍历
for i in home:
print(i)
# in not in index count
tp = ([1, 2, 3],)
tp[0].append(4)
print(tp)