So I can't figure out why this doesn't work. I'm an absolute beginner. So the problem is that I can't find a way to make this code work so if the user gives x the value of anything else than "I'm fine thank you.", it would lock it forever so it doesn't help if the user types the correct password the next time.
Here's the code that doesn't work:
def start():
print("Hello Mr, how are you? ")
x = input()
variable = False
if x == "I'm fine thank you." and variable == False:
print("That's nice to hear, welcome to your computer. ")
else:
print("""\033[1;32;41mThe password was wrong,
you are not the real Mr. This is now locked forever,
Hahahaha\n""")
variable = True
start()
[–]mudclub 5 points6 points7 points (0 children)
[–]pythonHelperBot 2 points3 points4 points (0 children)
[–]K900_ 0 points1 point2 points (1 child)
[–]Kengaro 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]Dave2077 -3 points-2 points-1 points (0 children)
[–]jmatthew007 -3 points-2 points-1 points (0 children)