Commit 61e409ea by BellCodeEditor

save project

parent d1b44670
Showing with 7 additions and 3 deletions
...@@ -4,9 +4,12 @@ import random ...@@ -4,9 +4,12 @@ import random
list=("石头","剪刀","布") list=("石头","剪刀","布")
l=random.choice(list) l=random.choice(list)
print("电脑出",l) print("电脑出",l)
if p==l: if p in list:
if p==l:
print("平局") print("平局")
elif (p=="剪刀" and l=="石头") or (p=="石头" and l=="布") or (p=="布" and l=="剪刀"): elif (p=="剪刀" and l=="石头") or (p=="石头" and l=="布") or (p=="布" and l=="剪刀"):
print("lose") print("lose")
else: else:
print("Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh") print("Ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh")
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