Commit 74e755c9 by BellCodeEditor

save project

parent 28316a47
Showing with 44 additions and 8 deletions
# 我们都爱夸夸夸
age = input("你今年多少岁啦?")
if int(age) > 12:
print("你今年比我大"+str(int(age)-12)+"岁")
elif int(age) < 12:
print("你今年比我小"+str(12-int(age))+"岁")
player = input("请输入石头、剪刀、布:")
print("玩家出拳:"+player)
if player == "石头":
p = 1
elif player == "剪刀":
p = 2
else:
print("你今年和我一样大!")
\ No newline at end of file
p = 3
import random as r
c = r.randint(1,3)
if c == 1:
computer = "石头"
elif c == 2:
computer = "剪刀"
else:
computer = "布"
print("计算机出拳:"+computer)
def pe1(c):
if c == 1:
print("平局。")
elif c == 2:
print("玩家赢了。")
else:
print("计算机赢了。")
def pe2(c):
if c == 2:
print("平局。")
elif c == 3:
print("玩家赢了。")
else:
print("计算机赢了。")
def pe3(c):
if c == 3:
print("平局。")
elif c == 1:
print("玩家赢了。")
else:
print("计算机赢了。")
if p == 1:
pe1(c)
elif p == 2:
pe2(c)
else:
pe3(c)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment