摘要:
列表是什么?1.列表是一系列按特定顺序排列的元素组成;2.列表可以包含字母,数字等; #简单列表示例 color=['red','bule','yello'] print(color) 访问列表元素 lan=["python","java","c","php"] print(lan[0].title 阅读全文
posted @ 2020-07-24 18:59
可可的测试小栈
阅读(187)
评论(0)
推荐(0)
摘要:
import this The Zen of Python, by Tim Peters Beautiful is better than ugly. 优美胜于丑陋(Python 以编写优美的代码为目标) Explicit is better than implicit. 明了胜于晦涩(优美的代码应 阅读全文
posted @ 2020-07-24 17:48
可可的测试小栈
阅读(186)
评论(0)
推荐(0)
摘要:
整数 #整数的加减乘除 乘方运算 print(2+3) print(3-2) print(2*3) print(3/2) print(3**2) 浮点数 print(0.1+0.1) print(2*0.1) #TODO:结果中包含的小数位数可能是不不确定的 print(0.1+0.2) print 阅读全文
posted @ 2020-07-24 17:47
可可的测试小栈
阅读(145)
评论(0)
推荐(0)
摘要:
#什么是字符串?字符串是一系列字符,用引号括起来(单引号,双引号) str1="这是字符串1" str2='这是字符串2' 修改字符串大小写 name="Itester coco" print(name.title()) #title()以首字母大写的方式显示每个单词(即每个首字母都改为大写) pr 阅读全文
posted @ 2020-07-24 16:54
可可的测试小栈
阅读(183)
评论(0)
推荐(0)
摘要:
Python变量 # TODO:变量错误示例 #名称错误 ''' 名称错误通常意味着两种情况: 1.使用变量前忘记了给它赋值; 2.输入变量名时拼写不正确; ''' msg="hello" # print(msgg) #将报错 ''' #简单消息:将一条消息存储到变量中,再将其打印出来。打印hell 阅读全文
posted @ 2020-07-24 16:18
可可的测试小栈
阅读(199)
评论(0)
推荐(0)

浙公网安备 33010602011771号