Commit 9fd32356 by BellCodeEditor

save project

parent 69425436
Showing with 21 additions and 2 deletions
palyer = input("出拳吧") player = input("出拳吧")
print("玩家出拳为:"+ palyer) print("玩家出拳为:"+ player)
import random import random
computer=["剪刀","石头","布"] computer=["剪刀","石头","布"]
leeter=random.choice(computer) leeter=random.choice(computer)
print("人机为"+leeter) print("人机为"+leeter)
if player in computer:
if player==leeter:
print("平局")
elif player=="剪刀" and leeter=="布":
print("玩家胜利")
elif player=="剪刀" and leeter=="石头":
print("人机胜利")
elif player=="石头" and leeter=="剪刀":
print("玩家胜利")
elif player=="石头" and leeter=="布":
print("人机胜利")
elif player=="布" and leeter=="石头":
print("玩家胜利")
elif player=="布" and leeter=="剪刀":
print("人机胜利")
else:
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