fork download
  1. # example data
  2. read = ["user,123", "admin,admin"]
  3. username = "user"
  4. password = "1234"
  5.  
  6.  
  7. found = False
  8. for line in read:
  9. details = line.split(",")
  10. if details[0] == username:
  11. print("found username")
  12. if details[1] == password:
  13. print("correct password")
  14. found = True
  15. break
  16. else:
  17. print("however, password doesn't match")
  18.  
  19. if not found:
  20. print("no match found")
Success #stdin #stdout 0.01s 27712KB
stdin
Standard input is empty
stdout
found username
however, password doesn't match
no match found