Python Forum

Full Version: [split] Set bool variable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't believe I'm having so much trouble creating a boolean variable! I just want to tell my program to set a boolean to true if two strings match each other:
word = "dink"

bool("guessStringMatches")#error: invalid syntax
guessStringMatches = false#NameError: name 'false' is not defined

guess = str(input("What's the word you dink head?"))

if guess == word:
print("you guessed the word correctly.")
guessStringMatches = true
 
Quote:guessStringMatches = false#NameError: name 'false' is not defined
its False and True

you also need to make a new thread as this has nothing to do with the previous