Commit 4db939d4 by BellCodeEditor

save project

parent d4ce7fed
Showing with 110 additions and 0 deletions
import random
c=input("请问你是否参见石头剪刀布比赛(“是”或者“否”):")
if c=="是":
name=input("请输入姓名:")
print(name+"欢迎参加")
p1=input("石头/剪刀/布")
print("玩家出拳",p1)
p2=random.choice(["石头","剪刀","布"])
print("计算机出拳",p2)
if p1=="布"and p2=="石头"or p1=="石头"and p2=="剪刀"or p1=="剪刀"and p2=="布"
print("玩家赢")
if p2=="布"and p1=="石头"or p2=="石头"and p1=="剪刀"or p2=="剪刀"and p1=="布"
print("计算机赢")
if p1==p2:
print("平局")
else:
print("退出程序")
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