Last active
March 25, 2016 20:03
-
-
Save Torxed/56098612df43cfdf39c7 to your computer and use it in GitHub Desktop.
simple login example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Definerer databasene og | |
database = {'Andreas' : 'Password1', | |
'Andy' : 'Password2'} | |
#Definerer funksjonene | |
def godkjent(): | |
print ('Halla ' +bruker) | |
def ikkegodkjent(): | |
print ('Beklager ' +bruker+ ', du har ikke tilgang her') | |
#Spør etter brukernavn og passord | |
print ('Hallo, og velkommen') | |
print ('Vennligst skriv inn dina inloggningsuppgifter') | |
bruker = input('Username: ') | |
passord = input('Password: ') | |
if bruker in database and database[bruker] == passord: | |
godkjent() | |
else: | |
ikkegodkjent() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment