我的第四个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")
原文地址:https://www.cnblogs.com/fansik/p/7610238.html