def show_updata_list(self):
dict1 = {"name":"玛卡巴卡","phone":"120","address":"上海虹桥"}
for i,j in dict1.items(): #遍历字典键值对
if len(j) > 2:
dict1[i] = j[:2] #存字典 字典名[键] = 值
return dict1
调用函数 f6 = MyCar(a,b) print(f6.show_updata_list())