Feb-20-2021, 03:05 AM
SOLVED
first time in python forum
i would say im fairly intermidiate to python, so this problem happened:
my code:
first time in python forum
i would say im fairly intermidiate to python, so this problem happened:
my code:
#Toggling Off Shell toggleonoff = False users = [] passwords = [] account = {} header = "loginshell.py: " while toggleonoff == False: currenttype = input(header) if currenttype == "adduser": #Adding User Command users.append(print("Username is " + input("Please type in new username: "))) passwords.append(print("Password is " + input("Please type in your password: ") + ". Added account." )) account[users[len(users) - 1]] = passwords[len(passwords) - 1] elif currenttype == "login": #Logging In loguser = input("Type in which user to log in to: ") x = 0 for user in users: if user == loguser: print("test123") elif x > len(users): break x=x+1 elif currenttype == "exit": exit() else: print("Please try again. ")so this program is basically a shell, but then for users to login. making as side project. when i add two new users, by typing in adduser, whioh command for adding new users and then i try to login with lets say the second user, its supposed to say test123 but instead it shows nothing. just the input for the looping. kind of hard to explain, but by the input of the loop,i mean that i made a loop that gives a input alwys until program ends. Using Python 3.9.1, in Sublime Text.