2018年5月31日

摘要: #简单的语句,感觉比for循环容易明白a = 0 while a < 9: a += 1 b = 1 while b <= a: print(a,end = "*") print(b,end = "=") print(a*b,end = " ") b += 1 print() 阅读全文
posted @ 2018-05-31 20:11 随风潜入夜~ 阅读(142) 评论(0) 推荐(0) 编辑
 
摘要: 1 num = 0 2 num =+ 1 3 print(num) 4 5 6 num = 2 7 num =+ 1 8 print(num)为什么这2段代码打印出来的值 都是1????备注:找到原因了 python 没有 =+运算符 num =+ 1 相当于 num = +1赋值了 阅读全文
posted @ 2018-05-31 16:15 随风潜入夜~ 阅读(130) 评论(0) 推荐(0) 编辑
 
摘要: 最简单的代码 if else if else 1、python中else if 用 elif表示 2、注释: 单行注释:##### 多行注释:''' ''',""" """,三个单引号 或者3个双引号 阅读全文
posted @ 2018-05-31 11:32 随风潜入夜~ 阅读(182) 评论(0) 推荐(0) 编辑