diff --git a/SimpleLoginRegistrationSystem.py b/SimpleLoginRegistrationSystem.py new file mode 100644 index 0000000..08804d7 --- /dev/null +++ b/SimpleLoginRegistrationSystem.py @@ -0,0 +1,42 @@ +usernames = ["Johnrey","Mary","Jonas","Brix"] +passwords = [202211615,202211616,202211617,202211618] + +def inputUser(): + username = input("Enter your username: ") + password = int(input("Enter your password: ")) + + i = 0 + while i < len(usernames) and len(str(password)): + if username == usernames[i] and password == passwords[i]: + print("Success Login") + break + elif username == usernames[i]: + print("Your password doesn't match your username.") + break + elif username != usernames[i] and password != passwords[i]: + i = i + 1 + elif usernames[i] and passwords[i] != username and password: + print("Pls try Again") + break + else: + print("Invalid username or password") + asking() + + +def asking(): + question = input("Do you want to register Yes or No? :") + if question == "Yes": + username = input("Enter your username: ") + password = int(input("Enter your password: ")) + usernames.append(username) + passwords.append(password) + print("Successfully Registered") + question = input("Do you want to Log In Yes or No? :") + if question == "Yes": + inputUser() + else: + print("Thankyouu for using our system") + else: + print("Thankyouu for using our system") + +inputUser() \ No newline at end of file