Bird
0
0

You want to improve a Raspberry Pi login program to lock the user out after 3 failed attempts. Which approach is best?

hard🚀 Application Q15 of 15
Raspberry Pi - Security and Deployment
You want to improve a Raspberry Pi login program to lock the user out after 3 failed attempts. Which approach is best?
AUse a counter variable to track failed attempts and stop after 3
BChange the password automatically after 3 tries
CPrint 'Access granted' even if password is wrong 3 times
DRestart the Raspberry Pi after each failed attempt
Step-by-Step Solution
Solution:
  1. Step 1: Understand the goal of locking out after 3 failures

    We need to count failed tries and stop allowing login after 3.
  2. Step 2: Evaluate options for implementing this

    Using a counter variable to track attempts is the correct and simple method.
  3. Final Answer:

    Use a counter variable to track failed attempts and stop after 3 -> Option A
  4. Quick Check:

    Counting attempts controls login lockout [OK]
Quick Trick: Count failed tries with a variable to limit attempts [OK]
Common Mistakes:
MISTAKES
  • Changing password automatically without user consent
  • Allowing access despite wrong passwords
  • Restarting device unnecessarily on failure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes