Enter the password to limit the number five bank python program realization

python bank password five times limitation procedure implemented, mainly for the processing of the statement written in an abnormal condition, need to write while loop statement using the try and except exception handling and the compound statement 
n-= 0
while n-<. 5:
try:
S = eval (input ( "Please enter your bank card password:"))
BREAK
the except:
the while n-<. 4:
n-n-+. 1 =
Print ( "incorrect password the bank card number as well as the remaining {} times, re! input: ")" the format (. 5-n-), End =. "
the try:
S = the eval (iNPUT ())
BREAK the except: Continue BREAK IF n-<. 4: Print ("! password confirmation, start reader ") the else: Print ( "password is the remaining number 0, not re-enter")execution results as follows:








Guess you like

Origin www.cnblogs.com/Yanjy-OnlyOne/p/11992577.html