Question = ""
print("What would you like?")
if Question == "Log out":
print("Logged out. Please close the page.")
else:
print("Goodbye")
input("\n\nPress enter key to exit")
I want my code (when it is running) to ask me what I want and it does that, but it goes straight to ‘Press enter key to exit’ and I don’t get a chance to answer.
How do I make the code the code ask me what I want and let me reply.
Thanks for any help!!!
PS I will create more questions that I can ask.
security = 0
username = ""
while not username:
username = input("Username: ")
password = ""
while not password:
password = input("Password: ")
if username == "Mia R" and password == "I'm awesome":
print("Welcome Master!")
security = 100
elif username == "Harriet R" and password == "Harriet3106":
print ("Welcome Harriet.")
security = 50
elif username == "Annabel R" and password == "Jane3170":
print ("How are you doing Annabel?")
security = 50
elif username == "Jane R" and password == "Annabel":
print("Good day Mummy.")
security = 50
elif username == "Jonathan R" and password == "Annabel02":
print("Hello daddy!")
security = 50
elif username == "guest" and password == "guest":
print("Welcome guest.")
security = 1
else:
print("Login failed. You're not so exclusive are you.\n")
print("security level = ")
print(security)
if security>=1:
Question = ""
NO1 = ""
NO2 = ""
while not Question:
Question = input("What would you like?")
if Question == "Log out":
print("Logged out. Please close the page.")
elif Question == "Please call someone":
int(input("Please enter the number"))
elif Question == "Please email someone":
input("Please enter email adress")
elif security>=50:
Question = ""
NO1 = ""
NO2 = ""
while not Question:
Question = input("What would you like?")
if Question == "Please add two numbers":
while not NO1:
NO1 = int(input("Please enter first number"))
while not NO2:
NO2 = int(input("Please enter second number"))
print("The sum of the numbers is ")
print(NO1+NO2)
elif Question == "Please multiply two numbers":
while not NO1:
NO1 = int(input("Please enter first number"))
while not NO2:
NO2 = int(input("Please enter second number"))
print("The product of the numbers is ")
print(NO1*NO2)
if security>=100:
Question = ""
NO1 = ""
NO2 = ""
while not Question:
Question = input("What would you like?")
if Question == "Please subtract two numbers":
while not NO1:
NO1 = int(input("Please enter first number"))
while not NO2:
NO2 = int(input("Please enter second number"))
print("The difference of the numbers is ")
print(NO1-NO2)
elif Question == "Please divide two numbers":
while not NO1:
NO1 = int(input("Please enter first number"))
while not NO2:
NO2 = int(input("Please enter second number"))
print("The answer to the question is ")
print(NO1/NO2)
else:
print("Goodbye")
input("\n\nPress enter key to exit")
I have fixed the problem I had before. I have another problem though. My code is supposed to stop people who have a lower security cannot ask as many questions. I tried as Jane R, it asked me what I wanted, but when I asked it to add two numbers it went straight to ‘Press the enter key to exit’ even though it should of asked me what my first number was.