highschool help
not a python programmer and also maybe i'm too tired but isn't this wrong?
while user != "1" or user != "2":
or means if any of the conditions are true, then do what follows
so let's say you have
1 user!=1 is false, but user !=2 is true, so false or true = true the result is true
2 user != 1 is true, user !=2 = false ... true or false = true
anything else : true or true = true
so this happens no matter what input you give, it's infinite loop?
why not do whatever python has for a switch statement
consider changing your login_screen function to do input("username:") and input("password:") only once .... basically put those into a loop and test stuff and put results in a variable ex something like
repeat = true
while (repeat== true)
repeat = false
name = input("user:")
pass = input("pass:")
if name != "something" repeat = true
....
end while
// you get here when repeat remains false (all checks passed)
same for inputstudent function
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now