摘要: 一、列表 1)、什么是列表?如何创建列表? 列表是python中最常见的一种数据类型,使用"[]"中括号将数据括起来,逗号分开 如:list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5 ] list3 = ["a", 阅读全文
posted @ 2020-04-24 12:08 布谷鸟的春天 阅读(448) 评论(0) 推荐(0) 编辑
摘要: 一、python中字符串的格式化输出 1)、使用加号来连接字符串。如果有非字符比如数字等可通过str()强制转换为字符型 例如: print("Today is "+"Friday!") print("You are "+str(20)+" years old!") 2)、使用%进行格式化输出。%s 阅读全文
posted @ 2020-04-24 10:52 布谷鸟的春天 阅读(464) 评论(0) 推荐(0) 编辑