Commit 0c5ccab8 by BellCodeEditor

auto save

parent b8933070
Showing with 17 additions and 2 deletions
...@@ -11,5 +11,20 @@ ...@@ -11,5 +11,20 @@
# pen.right(144) #向右移动144度,注意这里的参数一定不能变 # pen.right(144) #向右移动144度,注意这里的参数一定不能变
# pen.end_fill() #结束填充红色 # pen.end_fill() #结束填充红色
# turtle.done() # turtle.done()
import random
plare=input("请出拳(石头/剪刀/布):") plare=input("请出拳(石头/剪刀/布):")
print("玩家出拳:"+plare) print("玩家出拳:"+plare)
\ No newline at end of file list=["石头","剪刀","布"]
computer=random.choice(list)
print("计算机出拳:"+computer)
if plare in list:
if plare==computer:
print("平局")
elif ((plare=="布" and computer=="石头") or
(plare=="石头" and computer=="剪刀") or
(plare=="剪刀" and computer=="布")):
print("玩家赢了")
else:
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