Commit b1f8089d by BellCodeEditor

save project

parent 220fe62b
Showing with 38 additions and 0 deletions
import random
# 玩家出拳
rquan = input("你出什么?(石头\剪刀\布):")
while not rquan in (["石头","剪刀","布"]):
rquan = input("你出什么?(石头\剪刀\布):")
print("玩家出的是:" + rquan)
#电脑出拳
dquan=random.choice(["石头","剪刀","布"])
print("电脑出的是:" + dquan)
if rquan=="布":
if dquan=="布":
print("平局!")
if dquan=="石头":
print("人类赢了!")
if dquan=="剪刀":
print("电脑赢了!")
if rquan=="石头":
if dquan=="布":
print("电脑赢了!")
if dquan=="石头":
print("平局!")
if dquan=="剪刀":
print("人类赢了!")
if rquan=="剪刀":
if dquan=="布":
print("人类赢了!")
if dquan=="石头":
print("电脑赢了!")
if dquan=="剪刀":
print("平局!")
input()
\ 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