摘要:
内置函数 len(dict),计算字典元素个数,即键的总数 dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'} len(dict) # 3 str(dict),输出字典,以可打印的字符串表示 dict = {'Name': 'Runoob', 阅读全文
posted @ 2020-10-20 20:31
lixin2020
阅读(98)
评论(0)
推荐(0)
摘要:
元组的更改 元组中的元素值是不允许修改的,但可以对元组进行连接组合 tup1 = (12, 34.56) tup2 = ('abc', 'xyz') # 以下修改元组元素操作是非法的。 # tup1[0] = 100 # 创建一个新的元组 tup3 = tup1 + tup2 print (tup3 阅读全文
posted @ 2020-10-20 19:56
lixin2020
阅读(95)
评论(0)
推荐(0)
摘要:
列表函数 len(list),list为要计算元素个数的列表返回列表元素个数 list1 = ['Google', 'Runoob', 'Taobao'] print (len(list1)) # 3 list2=list(range(5)) # 创建一个 0-4 的列表 print (len(li 阅读全文
posted @ 2020-10-20 19:35
lixin2020
阅读(203)
评论(0)
推荐(0)

浙公网安备 33010602011771号