Unit 2 Task 16: ATM PIN (three tries)

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 2 Task 16 - ATM PIN (three tries)

← Unit 2 tasks · Solution


The correct PIN is 2468. The user has at most 3 attempts.

You can use a for loop over three attempts with break, or a while with a counter.

Skills: loop + if / else, early exit.