You are implementing security measures on a server. If a user has more than 3 failed login attempts, the program should print “locked out”. The number of failed login attempts is stored in a variable called failed_attempts. Which conditional statement has the correct syntax needed to do this?

Automate Cybersecurity Tasks with Python | Weekly challenge 1 Quiz | 

You are implementing security measures on a server. If a user has more than 3 failed login attempts, the program should print “locked out”. The number of failed login attempts is stored in a variable called failed_attempts. Which conditional statement has the correct syntax needed to do this?

  • if failed_attempts <= 3:
    print(“locked out”)
  • if failed_attempts < 3
    print(“locked out”)
  • if failed_attempts >= 3
    print(“locked out”)
  • if failed_attempts > 3:
    print(“locked out”)

 

 

Leave a Comment