![]() |
[split] Set bool variable - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: [split] Set bool variable (/thread-5805.html) |
[split] Set bool variable - RedSkeleton007 - Oct-22-2017 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 RE: Basic string manipulation - metulburr - Oct-22-2017 Quote:guessStringMatches = false#NameError: name 'false' is not definedits False and True you also need to make a new thread as this has nothing to do with the previous |