Commit bb503502 by BellCodeEditor

save project

parent 4b34bbea
Showing with 13 additions and 10 deletions
...@@ -4,13 +4,16 @@ import random ...@@ -4,13 +4,16 @@ import random
list=["石头","剪刀","布"] list=["石头","剪刀","布"]
computer=random.choice(list) computer=random.choice(list)
print("computer'choice:"+computer) print("computer'choice:"+computer)
if choice==computer : if choice in list:
print("draw") if choice==computer :
elif choice=="剪刀" and computer=="布" : print("draw")
print("computer lose") elif choice=="剪刀" and computer=="布" :
elif choice=="石头" and computer=="剪刀" : print("computer lose")
print("computer lose") elif choice=="石头" and computer=="剪刀" :
elif choice=="布" and computer=="石头" : print("computer lose")
print("computer lose") elif choice=="布" and computer=="石头" :
print("computer lose")
else:
print("player lose")
else: else:
print("player lose") print("Please enter: rock, scissors or paper!")
\ 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