tup1=()#创建一个新元组
print(type(tup1))
tup2=(50,)#单个值要加个逗号
print(type(tup2))
'''
'''
tup1=('abc','def',2000,2020)
print(tup1[0])
print(tup1[-1])#访问最后一个元素
print(tup1[1:5])#左闭右开
'''
'''
#增 连接
'''
'''
tup1=(12,15,66)
tup2=("abc","acd")
tup=tup1+tup2
print(tup)
'''
'''
#删
tup1=(12,15,66)
print(tup1)
del tup1#删除元组变量
print(tup1)
'''
#字典的定义
info={"name":"彭于晏","age":18}
#字典的访问
print(info["name"])
print(info["age"])
【无标题】
最新推荐文章于 2024-08-27 16:38:10 发布