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

Administrator / pygame_lesson7_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
  • pygame_lesson7_diy1
  • 2.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    auto save · 707b42fb
    BellCodeEditor committed 2 years ago
    707b42fb
2.py 270 Bytes
1 2 3 4 5 6 7 8 9 10 11
import random
num=random.randint(1,100)
while True:
    a=int(input('请输入要猜的数字(1-100):'))
    if a==num:
        print('恭喜你,猜对了。')
        exit()
    elif a>num:
        print('猜大了')
    else:
        print('猜小了')