摘要: 第一版,缺点只能猜一次。 1 age_of_archerzon = 22 2 3 guess_age = int(input("guess age:")) 4 5 if guess_age == age_of_archerzon: 6 print("Yes,you got it!") 7 elif 阅读全文
posted @ 2018-08-13 21:28 archerzon 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 结构: 1 for i in range(10): 2 print(i) 每隔1个数打印一次(插值): 1 for i in range(0,10,2) 2 print(i) for循环里面嵌套一个for循环: 1 for i in range(10): 2 print(" ",i) 3 for j 阅读全文
posted @ 2018-08-13 21:02 archerzon 阅读(155) 评论(0) 推荐(0) 编辑
摘要: while循环: 1 count = 0 2 3 while True: 4 print("count:%s"%count) 5 count += 1 6 if count >1000: 7 break 阅读全文
posted @ 2018-08-13 20:55 archerzon 阅读(100) 评论(0) 推荐(0) 编辑