Commit 07d4e2b8 by BellCodeEditor

save project

parent faa40140
Showing with 13 additions and 9 deletions
...@@ -4,17 +4,21 @@ import random ...@@ -4,17 +4,21 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
cumputer=random.choice(list) cumputer=random.choice(list)
print(cumputer) print(cumputer)
if computer==player: if player in list:
if computer==player:
print("平局") print("平局")
elif piayer=="石头"and computer=="剪刀" elif piayer=="石头"and computer=="剪刀"
print("恭喜,你赢了") print("恭喜,你赢了")
elif piayer=="剪刀"and computer=="石头" elif piayer=="剪刀"and computer=="石头"
print("输了") print("输了")
elif piayer=="布"and computer=="剪刀" elif piayer=="布"and computer=="剪刀"
print("输了") print("输了")
elif piayer=="布"and computer=="石头" elif piayer=="布"and computer=="石头"
print("恭喜,你赢了") print("恭喜,你赢了")
elif piayer=="石头"and computer=="布" elif piayer=="石头"and computer=="布"
print("输了") print("输了")
elif piayer=="剪刀"and computer=="布" elif piayer=="剪刀"and computer=="布"
print("恭喜,你赢了") print("恭喜,你赢了")
\ No newline at end of file
eles:
print("输入错误")
\ 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