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

bellcode / lesson2-5_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-5_DIY1
  • Untitled-1.py.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 15df6836
    BellCodeEditor committed 3 years ago
    15df6836
Untitled-1.py.py 502 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
player=input("玩家出拳(石头/剪刀/布)")
print("玩家出拳:"+player)
import random
list=["石头","剪刀","布"]
letter=random.choice(list)
print("电脑出拳:"+letter)
if player in list:
    if letter==player:
        print("平局")
    elif (letter=="石头" and player=="布") or (letter=="布" and player=="剪刀") or (letter=="剪刀" and player=="石头"):
        print("玩家赢")
    else:
        print("很遗憾,你受苦了")
else:
    print("输入错误")