I wrote my code for the boolean and when I press Run it isn’t accepted; why is this?
Python, and all programming languages, require you to match their syntax exactly. Note that there are no quotation marks around a boolean value, and that they are capitalized. In other languages you may see booleans written as
false, but in Python they must be
False. Keep that in mind for future exercises where you’ll be asked to check if something is True or False so you don’t compare to a string, like
Take a look at the code below for a better understanding:
bool_1 = True bool_2 = False bool_3 = true # invalid bool_4 = false # invalid bool_5 = "true" # invalid bool_6 = "false" # invalid