一.取出字典中所有的key-value student={'name':'xiaoming','age':11,'school':'tsinghua'} for key,value in student.items(): print(key+':'+str(value)) 二.取出字典中所有的keys people={'lifei':'apple','fanming':'peach','gaolan':'banana','hanmeimie':'peach'} for name in peopl
字符串操作 name = "alex" print(name.capitalize()) #首字母大写 name = "my name is alex" print(name.count("a")) #统计字母"a"的数量 print(name.center(50,"-")) #一共打印50个字符,变量name在中间,其余用"-"补足 print(name.endswith("