I am making a program where you can login, logout and access some settings, but I seem to be encountering an issue after logging out. I'm doing the logout by just calling the function containing the login code, but when it reaches the logout state it just ends the script instead of going back. The Code:
def main():
UserName = input ("Enter Username: ")
if UserName == 'a':
print ("Login successful")
logged()
else:
print ("Username is incorrect")
main()
def logged():
print ("starting system...")
main()
print("welcome to joop databases")
def options():
print (" ")
print ("[1]", end =" ")
print ("Settings")
print(" ")
Selection = input ("")
if Selection == '1':
print (" Settings")
print (" ")
print ("[x]", end =" ")
print ("close")
print (" ")
print ("[1]", end =" ")
print ("Log out")
print (" ")
Settings = input('')
if Settings == 'x':
options()
elif Settings == '1':
main()
options()
Anyway I'm an absolute beginner, I started yesterday, so if you could give simple answers it would be much appreciated haha.