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

bellcode / lesson3-1-1_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
  • lesson3-1-1_DIY1
  • diy1.py
Find file
BlameHistoryPermalink
  • BellCodeEditor's avatar
    save project · fea54931
    BellCodeEditor committed a year ago
    fea54931
diy1.py 849 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
i=3
username = "python"     #保存在服务器中的用户账号(正确的账号)
userpassword="123456"        #把存在服务器数据库中的用户密码(正确的密码)
#input()实现用户输入账号,密码的功能
while True:
    if i>0:
        name=input("请输入用户名")
        password=input("请输入密码")
#如果用户输入的账号,密码正确,提示登录成功
        i-=1
        if name==username and password==userpassword:
            print("登陆成功")
            break
        elif name != username:
            print("用户名不存在,请重新输入")
            continue
        else:
            print("密码错误,请重新输入")
    else:
        print("你的账户已被锁定,请一个小时后再来")
        exit()
print("欢迎来到贝尔编辑器")