Practice: Nested Conditions

« Read the chapter

Q21. ATM withdrawal

IntermediateApplication

balance=500, pin_ok=True, amount=700. If pin_ok, print 'Done' when amount <= balance else 'Insufficient funds'. If PIN is wrong print 'Bad PIN'.

Goal: Layer checks in an ATM.