Below is a program that asks the user to input a username and password. Once logged off the user is asked to re-enter their username and password.
Is the program correct where it checks if the username and password input before is correctly input again?.
Any help would be welcome
Regards
Mark
# program that checks that the username and password are correct #
username = input("Please enter your username : ")
password = input("Please enter your password : ")
print ("Greetings," , username, "you are now logged in now with a password")
command = input("Please type a command :")
if command == "log off":
print ("You have now been logged off again",username)
username == ""
password == ""
username = input("Please enter your username : ")
password = input("Please enter your password : ")
while (username != "username" and password != "password")
print (" Sorry username and password incorrect please re-enter for validation ")
username = input("Please enter your username : ")
password = input("Please enter your password : ")
else:
print ("Greetings," , username, "you are now logged in now with your password")