摘要: 字典 #创建字典 info = { 'stu01': 'zhangsan', 'stu02': 'lisi', 'stu03': 'wangwu' } #字典生成式(字典生成式可以通过一行代码快速生成一个字典,其语法如下:) result = {key: value for item in iter 阅读全文
posted @ 2022-09-24 15:07 ZYT666 阅读(38) 评论(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 阅读(26) 评论(0) 推荐(0)