If function in Login

oleh:
arif zainurrohman
 
# Exclusive Network
# Demonstrates logical operators and compound conditions

print("\tExclusive Computer Network")
print("\t\tMembers only!\n")

security = 0

username = ""
while not username:
    username = raw_input("Username: ")

password = ""
while not password:
    password = raw_input("Password: ")

if username == "arif" and password == "secret":
    print("Hi, Arif.")
    security = 5
elif username == "rafi" and password == "secret1":
    print("Hey, rafi.")
    security = 3
elif username == "alif" and password == "secret2":
    print("What's up, alif?")
    security = 3
elif username == "hasan" and password == "secret3":
    print("How goes it, Will?")
    security = 3
elif username == "guest" or password == "guest":
    print("Welcome, guest.")
    security = 1
else:
    print("Login failed. You're not so exclusive.\n")
raw_input("\n\nPress the enter key to exit.")
 
 
 
 Ibu kota, 5 muharram 1435 H
 

0 komentar:

Posting Komentar