Answer to Question #227713 in Python for heyy

Question #227713

make an algorithm using pseudocode and python which will get atm pin code from user. if the pin is "1234" then it should display correct otherwise if the pin is incorrect 3 times it should display account locked



1
Expert's answer
2021-08-20T01:09:34-0400
// corecudr
test = True
attempt = 0


while test:
    n = int(input())
    if n == 1234:
        print("Correct")
        test = False
    else:
        attempt += 1
    if attempt == 3:
        print("Your account has been locked")
        test = False

Example:

12345
6578
890
Your account has been locked


1234
Correct


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS