# 1, write a program log, # 1, up to the landing failed three times # 2, the login is successful, suggesting welcome xx login, today's date is xxx, end of program # 3, to check whether the input is not empty, the account number and password empty # 4, a case-insensitive account Import Time usesnames = [ ' bairuifeng ' ] Passwords = [ ' 123456 ' ] Time = The time.strftime ( ' % Y-M-%%% X-D ' ) for I in Range ( . 3 ): usesname = iNPUT ( ' enter account number: ' ) .strip () Lower (). password = iNPUT ( 'Please enter your password: ' ) .strip () IF len (usesname) == 0 and len (password) == 0: Print ( ' ! Account password can not be empty ' ) elif usesname == usesnames [0] and password == Passwords [0]: Print ( ' successful login, login prompt Welcome% s, today's date is% s ' % (usesname, Time)) BREAK the else : Print ( ' number of errors have been exhausted! ' )
Python-day1 landing jobs
Guess you like
Origin www.cnblogs.com/brf-test/p/12227179.html
Ranking