Commit 961fd6b0 by BellCodeEditor

save project

parent 95a1e0c8
Showing with 17 additions and 0 deletions
import random
list1=["石头","剪刀","布"]
computer=random.choice(list1)
print(computer)
print(type(computer))
user=input("请输入石头/剪刀/布")
print(user)
if user in list1 :
if (computer=="石头" and user=="布") or (computer=="剪刀" and user=="石头") or (computer=="布" and user=="剪刀") :
print("赢了")
elif computer==user :
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