Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson2-1-2_DIY1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • lesson2-1-2_DIY1
  • j.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · e45163e2
    BellCodeEditor committed 3 weeks ago
    e45163e2
j.py 449 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
o=input("请出(石头/剪刀/布)")
print("玩家已输入"+o)
import random
h=["石头","剪刀","布"]
a=random.choice(h)
print("计算机 :"+a)
if o in h:
    if o==a:
        print("平局")
    elif (o=="石头" and a=="剪刀") or (o=="剪刀" and a=="布") or (o=="布" and a=="石头"):
        print("你赢了,你太厉害了")
    else:
        print("很遗憾,你输了")
else:
    print("玩家输入错误")