0

so ive been coding a menu function so that way when I run it I can just run other functions so that way I control where they can go and cant go but my input and functions don't work together and for some reason only run the first if statement instead of running through the other if and elif statements.

HELP.

MCR = "Danny"
GreenDay = "hello"

email1 = 'danny'
emailp1 = '123'




def menu():
print("|   Hello and welcome to the V.A.S. menu")
print("-----------------------------------------")
print("|| MENU")
print("////////")
print("[1] Admin Login")
print("[2] Start System")
print("|   please select one of the options")
print("|   above by entering the number boxed")
print("|   in number next to the option you want")
print("|   to access")
mensu = input("||Option: ")
if mensu != "admin login" or "start system":
    print("/////////////////////")
    print("")
    print("You didnt enter anything")
    print("")
    print("/////////////////////")
    menu()
elif mensu == "1" or mensu.lower("admin login"):
    mesuadisc()
elif mensu == 2 or mensu.lower("start system"):
    mesustartsy()


def mesuadisc():
print("|> If you would like to go back to the menu")
print("|> please just type in menu to (Username: )")
print("|  Please enter admin login info")
admesu = input("||Username: ")
admensus = input("||Password: ")
if admesu == MCR and admensus == GreenDay:
    admossettings()
elif admesu != MCR and admensus != GreenDay:
    print("Sorry thats incorrect")
    menu()
elif admesu == admesu.lower("menu"):
    menu()




def admossettings():
print("|  Welcome to Admin Settings")
print("----------------------------------------")
print("|> If you would like to go back to the menu")
print("|> please just type in menu at (Option: )")
print("|| MENU")
print("////////")
print("[1] Email Information(Important)")
print("[2] Add Staff or Students to System")
print("|   please select one of the options")
print("|   above by entering the number boxed")
print("|   in number next to the option you want")
print("|   to access")
admensus = input("||Option: ")
if admensus == "1" or "Email Information" or "email information" or "EMAIL INFORMATION":
    print("|  The email address below is a permanent")
    print("|  dedicated email address to the system witch")
    print("|  can access the email info here any time.")
    print("||Email Address : " + email1)
    print("||Email Password : " + emailp1)
    print("--------------------------------------------------")
    print("|> if you would like to head back to the admin menu or")
    print("|> the normal menu please type in menu or admin menu into (Option: )")
    getback = input("||Option: ")
    if getback != getback.lower("menu") or getback.lower("add staff or students to system") or 1 or 2:
        print()
    elif getback == getback.lower("admin menu"):
        admossettings()
    elif getback == getback.lower("menu"):
        menu()
elif admensus == admensus.lower("add staff or students to system") or 2:
    print("")
elif admensus == admensus.lower("menu"):
    menu()
elif admensus != admensus.lower("menu") or admensus.lower("add staff or students to system") or 1 or 2:
    print()
  • I see that since yesterday you started using `.lower`, but you still have the same problem mentioned in the duplicate question: Namely instead of doing stuff like `if admensus == "1" or "Email Information"` you want to do `if admensus == "1" or admensus == "Email Information"`. Alternatively, you can do: `if admensus in ("1", "Email Information", "email information", "EMAIL INFORMATION")` – hostingutilities.com Jan 15 '21 at 20:17
  • `if x == "a" or "b"` is not the right way to check multiple values. See the linked question at the top. – John Gordon Jan 15 '21 at 20:19

0 Answers0