# ---------字典的嵌套--------
1 dic = {
2 'name':['alex','abc','efg'],
3 'som':{
4 'time':'123',
5 'sex':999,
6 'from':'aaa',
7 },
8 'age':14
9 }
10
11 dic['age'] = 100 # 直接修改 age
12 dic['name'].append('新的') # 找到 name(keys) 然后添加 新 的 keys
13 dic['name'][1] = dic['name'][1].upper() # 把 name 中的 第二个 元素 大写
14 dic['som']['new'] = 'newss' # 把 新的 keys,values 添加到 'som' 字典中
15 print(dic)
#-----------找出字符中的数字类型的个数(连在一起算一个)----------
1 info = input('>>>')
2 for i in info:
3 if i.isalpha():
4 info = info.replace(i,' ')
5 ls = info.split()
6 print(len(ls))