I'm new to python and I am trying to write a 'Guess the number program'. I am however getting the following error message:
Traceback (most recent call last): File "C:\Users\fdama\Documents\python\GuessMyNumber.py", line 8, in <module> guess = false NameError: name 'false' is not defined
I don't know why I am getting this error message. Are there such things as boolean variables in python?
Here is the code:
#Guess my Number game Ch 3 import random attempts = 1 number = random.randint(1,100) guess = false while guess == false: guess = input("Take a guess: ") if guess == number: print(" You guessed it! The number was " ,number) break elif guess < number: print("Higher...") attempts += 1 elif guess > number: print("Lower...") attempts += 1 input("\n\n Press the enter key to exit")
Thanks for your help.