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

Administrator / lesson4_5

  • 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
  • lesson4_5
  • y.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · 940b6988
    BellCodeEditor committed 2 years ago
    940b6988
y.py 693 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
username = "python"    # 保存在服务器数据库中的用户账号(正确的账号)
userpassword = "123456"    # 保存在服务器数据库中的用户密码(正确的密码)

# 请用input()实现用户输入账号、密码的功能
i=3 
while True:
    if i>0:
        a=input("账号")
        b=input("密码")
        i=i-1
        if a==username and b==userpassword:
            print("成功登录")
            break
        elif a!=username:
            print("用户名错误,重新输入")
        else:
            print("密码错误,重新输入")
    else:
        print("账号已被封锁")
        exit()
print('欢迎来到贝尔世界')