I'm having trouble with what I think MAY be a bug, or something that I'm missing.
This is the code:
#----------------------
import time
from time import sleep
#----------------------
class main():
def menu():
choice = input('Do you wish to register, or login?: ')
if choice == 'register' or 'Register' or 'REGISTER':
pass
if choice == 'login' or 'Login' or 'LOGIN':
main.login()
def login():
usr = 'SYSTEM'
pas = 'DEFAULT'
usr1 = input('Please type in your username credentials: ')
pas1 = input('Now please type in your password: ')
if usr != usr1 or pas != pas1:
print('Your username and/or password is incorrect.Please try again.')
time.sleep(3)
main.login()
if usr == usr1 and pas == pas1:
print('Success!')
def register():
print('This feature is currently un-available. A defualt System password has been generated.\n Username: SYSTEM \n Password: DEFAULT \n')
time.sleep(3)
print('You will now be redirected to the login menu.\n')
time.sleep(3)
main.login()
main.menu()
If you run this code, you will see that if you attempt to login straight away, it will ALWAYS return the register function.
Is this a bug, or am I being stupid?
Thanks,
Ciaran