First study python, Confused , Write a simple login verification , Take notes username = 'cc' # user name

userpassword = '123'    # password

count = 0         # Counter

while count<3:      # If the count is less than 3, Namely 0,1,2 Three times in total , Then execute the following code

_username = input("USER:")

_userpassword = input("PW:")

if _username == username and _userpassword == userpassword:   # Judge whether the user name and password entered by the user are consistent

print("wlcome",username,"back.~~v-v".format(username=username))

break    # If it is consistent, it will jump out of the loop

elif count<2:

print("not this user or password,try again")

count +=1

else:

print("lock!!!",username.format(username=username))

The code is simple , I hope I can write practical code in a year

Technology