# TODO(直角三角形 * 号)
# i = 1
# while i <= 5:
# print("*" * i)
# i += 1
# TODO(直角三角形 * 号) 第二种
# i = 1
# while i <= 5:
# j = 1
# while j <= i:
# print("*", end="")
# j += 1
# print("")
# i += 1
# TODO(矩形 * 号)
# i = 1
# while i <= 5:
# print("*" * 5)
# i += 1
# TODO(矩形 * 号) 第二种
# i = 1
# while i <= 5:
# j = 1
# while j <= 5:
# print("*", end="")
# j += 1
# print("")
# i += 1
# TODO(99乘法表)
# i = 1
# while i <= 9:
# j = 1
# while j <= i:
# print("%d * %d = %d" % (j, i, i*j), end="\t")
# j += 1
# print("")
# i += 1
# TODO(99乘法表) 第二种
# for i in range(1, 10):
# for j in range(1, i + 1):
# print("%d * %d = %d" % (j, i, i * j), end="\t")
# print("")
# TODO(剪刀石头布)
# import random
# while True:
# player = int(input("输入 0剪刀 1石头 2布:"))
# computer = random.randint(0, 2)
# if (player == 0 and computer == 2) or (player == 1 and computer == 0) or (player == 2 and computer == 1):
# print("电脑出的是 %d ,玩家赢了" % computer)
# elif player == computer:
# print("电脑出的是 %d ,平局" % computer)
# else:
# print("电脑出的是 %d ,电脑赢了" % computer)# TODO(剪刀石头布 第二种)
# import random
# while True:
# player = int(input("输入 剪刀 石头 布:"))
# computer = random.choice("剪刀","石头","布")
|
|