back to menu when register finished

This commit is contained in:
kouhe
2022-03-26 12:34:08 +08:00
parent ad13bfd453
commit 3fb43da711

View File

@@ -28,7 +28,7 @@ while True:
elif input_number == "2": elif input_number == "2":
input_username = input("Enter a username\n") input_username = input("Enter a username\n")
input_password = input("Enter a password\n") input_password = input("Enter a password\n")
# check if the username is in the dictionary so it is duplicate # check if the username is in the dictionary it is duplicate
if input_username in username_and_password: if input_username in username_and_password:
print("The username is duplicate!") print("The username is duplicate!")
else: else:
@@ -65,12 +65,11 @@ while True:
# add the username and password to the dictionary # add the username and password to the dictionary
username_and_password[input_username] = input_password username_and_password[input_username] = input_password
print("Register successfully!") print("Register successfully!")
print("Auto login...") # back to menu
exit() continue
else: else:
print("Wrong number!") # if the input is not 1 or 2, it will print wrong number print("Wrong number!") # if the input is not 1 or 2, it will print wrong number
os.system("pause") os.system("pause")
os.system("cls") os.system("cls")
# clear the screen # clear the screen