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.
Larz60+ write Feb-20-2021, 04:08 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.