repl.it
@BenjaminSMITH69/

user check2

Python

No description

fork
loading
Files
  • main.py
  • users.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
print("To access the game, enter the correct password.")

while True:
  userCheck = input("Password: ")
  if userCheck == "":
    print("Access Denied")
  else:
    with open ("users.txt","r") as f:
      f1 = f.readlines()
      for x in f1:
        x.find(userCheck)
        while True:
          if userCheck in x:
            print("Access Granted")
          elif userCheck not in x:
            print("Access Denied")
            f.close()
          break
    break          

?