fork download
  1. passwdList = ["123","456"]
  2. valid = False
  3. count = 3
  4. while count > 0:
  5. res = input("enter password:")
  6. for eachPasswd in passwdList:
  7. if res == eachPasswd:
  8. valid = True
  9. break
  10. if not valid: # (or valid == 0)
  11. print("invalid input")
  12. count -= 1
  13. continue
  14. else:
  15. break
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
passwdList = ["123","456"]
^
Main.java:10: error: illegal character: '#'
        if not valid: # (or valid == 0)
                      ^
2 errors
stdout
Standard output is empty