Skip to content

Instantly share code, notes, and snippets.

@HilmiZul
Created November 27, 2019 02:27
Show Gist options
  • Select an option

  • Save HilmiZul/6c0da0297d913e3176a1deefef7174f6 to your computer and use it in GitHub Desktop.

Select an option

Save HilmiZul/6c0da0297d913e3176a1deefef7174f6 to your computer and use it in GitHub Desktop.
Login with text as database
def login(user, password):
with open("user.txt") as f:
isi = f.readlines()
isi = [x.strip() for x in isi]
if user == isi[0] and password == isi[1]:
print("Login Berhasil")
else:
print("User dan Password tidak cocok!")
user = input('user: ')
password = input('password: ')
login(user, password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment