我的第四个Python小程序

简单的登陆程序:

# Author: fansik
# Description: Simply log in to small programs
# Date: 2017/9/29
_username = 'fansik'
_password = "fanjinbao"
count = 0
while count < 3:
    username = input("Username : ")
    password = input("Password : ")
    if username == _username and password == _password:
        print("Welcome %s login system.." % username)
        break
    else:
        print("Invalid username or password...")
        count += 1
        if count == 3:
            print("Want to try it,no or yes???")
            ask = input("Your choice: ")
            if ask == "yes":
                count = 0
else:
    print("system exit")

 

posted @ 2017-09-29 11:26  fansik  阅读(172)  评论(0编辑  收藏  举报