Skip to content

Instantly share code, notes, and snippets.

@collinsrj
Created February 17, 2021 15:10
Show Gist options
  • Save collinsrj/ebba56c05695dc6ef2a0c7d76ce31b1f to your computer and use it in GitHub Desktop.
Save collinsrj/ebba56c05695dc6ef2a0c7d76ce31b1f to your computer and use it in GitHub Desktop.
week 2 exercise
users = [
{'username': 'dz88', 'password': 'super-secret'},
{'username': 'DogL0ver42', 'password': 'mydogsnameisfreckles'},
{'username': 'punkrock3rgir1', 'password': 'joeyramone4lyfe'}]
not_logged_in=True
attempt_count=0
while not_logged_in and attempt_count < 3:
username = input('Enter your username: ')
password = input('Enter your password: ')
for user in users:
if user["username"] == username:
# Check if the password matches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment