Commit 59763db6 by BellCodeEditor

save project

parent 44496ab6
Showing with 18 additions and 8 deletions
import turtle
pen=turtle.Pen()
pen.fillcolor(yello)
pen.begin_fill()
for i in range(5):
pen.forward(100)
pen.left(144)
pen.end_fill()
turtle.done()
\ No newline at end of file
import random import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
player=input("石头,剪刀,布") while player in list:
player=input("石头,剪刀,布")
if not player in list:
print("请您换一个,重新来吧")
computer=random.choice(list) computer=random.choice(list)
print("你出的是:"+player) print("你出的是:"+player)
print("电脑出的是:"+computer) print("电脑出的是:"+computer)
if player in list: if player==computer:
if player==computer:
print("平局") print("平局")
elif (player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头"): elif (player=="石头" and computer=="剪刀") or (player=="剪刀" and computer=="布") or (player=="布" and computer=="石头"):
print("玩家赢") print("玩家赢")
else:
print("电脑赢")
else: else:
print("输入错误") print("电脑赢")
\ No newline at end of file \ 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