摘要: 字典 #创建字典 info = { 'stu01': 'zhangsan', 'stu02': 'lisi', 'stu03': 'wangwu' } #增加或者更改 info['stu04'] = 'zhaoliu' info.setdefault('stu01','www.baidu.com') 阅读全文
posted @ 2022-09-24 15:06 ZYT666 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 字符串: 字符串 name = "hello world!" name2 = 'HELLO WORLD' name3 = 'name is {name} and i am {year} old' #首字母大写 print(name.capitalize()) #将字符转换为小写 print(name 阅读全文
posted @ 2022-09-21 09:21 ZYT666 阅读(14) 评论(0) 推荐(0) 编辑