#variable from the original user name and passwordUsername ='Admin'Password='Nimda'#Variable from counterCount =0#Loop condition counter is less than 3, execution while code block whileCount < 3:#variable from user input user name and passwordInuser = input ('input Username:') Inpass= Input ('Input Password:')#if the user name or password is inconsistent with the system variable, add 1 to the counter, print the prompt, and re-cycle immediately ifInuser! = UsernameorInpass! =Password:count+ = 1Print('username or password error,please enter again') Continue#The code goes here to verify that it passed, print the prompt, and interrupt the loop Print('Welcome to Pythom are world') Break#when the while condition fails, the hint has only three chances. Else: Print('Sorry,juse Three')
While loop write 3 times user name password validator