Commit 0f0c9f6e by BellCodeEditor

save project

parent d4a1fad1
Showing with 12 additions and 1 deletions
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
Q=input("请输入石头\\剪刀" ) Q=input("请输入石头\\剪刀" )
print(" 玩家出拳"+Q) print(" 玩家出拳"+Q)
import random import random
a=("石头""布""剪刀") a=["石头","布","剪刀"]
computer=random.choice(a) computer=random.choice(a)
print(computer) print(computer)
if Q==computer:
print("平局")
elif Q=="石头" and computer=="剪刀"
print(赢了)
elif Q=="剪刀" and computer=="布"
print(赢了)
elif Q=="布" and computer=="石头"
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