摘要:
1 row = 1 2 while row <= 9: 3 col = 1 4 while col <= row: 5 print("%d*%d=%d\t" % (col, row, row * col), end="") 6 col += 1 7 print("") 8 row += 1 阅读全文
posted @ 2020-05-04 13:23
新生代农民工
阅读(172)
评论(0)
推荐(0)
摘要:
1 row=1 2 while row <= 5: 3 print("*"*row) 4 row+=1 阅读全文
posted @ 2020-05-04 13:06
新生代农民工
阅读(105)
评论(0)
推荐(0)
摘要:
1 import random 2 player = int(input("请输入您要出的拳:石头(1)/剪刀(2)/布(3):")) 3 computer = random.randint(1, 3) 4 print("玩家选择的是%d-电脑选择的是%d" % (player, computer) 阅读全文
posted @ 2020-05-04 12:44
新生代农民工
阅读(264)
评论(0)
推荐(0)
摘要:
1 player = int(input("请输入您要出的拳:石头(1)/剪刀(2)/布(3):")) 2 computer = 1 3 print("玩家选择的是%d-电脑选择的是%d" % (player, computer)) 4 if (player == 1 and computer == 阅读全文
posted @ 2020-05-04 12:38
新生代农民工
阅读(117)
评论(0)
推荐(0)
摘要:
1 Has_ticket = True 2 knife_length = 30 3 if Has_ticket: 4 print("车票检查通过,准备安检") 5 if knife_length > 20: 6 print("不允许通过") 7 else: 8 print("欢迎乘车") 9 els 阅读全文
posted @ 2020-05-04 12:24
新生代农民工
阅读(143)
评论(0)
推荐(0)
摘要:
1 holiday_name = "平安夜" 2 if holiday_name == "情人节": 3 print("买玫瑰 看电影") 4 elif holiday_name == "平安夜": 5 print("买苹果 吃大餐") 6 else: 7 print("每天都是节日") 阅读全文
posted @ 2020-05-04 12:12
新生代农民工
阅读(134)
评论(0)
推荐(0)
摘要:
1 is_employee = True 2 if not is_employee: 3 print("禁止进入") 4 else: 5 print("欢迎") 阅读全文
posted @ 2020-05-04 11:18
新生代农民工
阅读(208)
评论(0)
推荐(0)
摘要:
1 python_score = 80 2 c_score = 70 3 if python_score >= 60 or c_score >= 60: 4 print("通过") 5 else: 6 print("失败") 阅读全文
posted @ 2020-05-04 11:15
新生代农民工
阅读(141)
评论(0)
推荐(0)
摘要:
1 age = int(input("请输入年龄")) 2 if age>=18: 3 print("恭喜成年!\n") 4 else: 5 print("再等等哦\n") 阅读全文
posted @ 2020-05-04 11:10
新生代农民工
阅读(134)
评论(0)
推荐(0)