Great. You already discovered three basic variable types: integers, floats, and strings. To better understand conditional statements, we should first introduce another variable type:
boolean. Boolean variables store logical values. They are named "Boolean" after the famous English logician George Boole.
Boolean variables can only take one of two values:
False. There are lots of built-in functions in Python that will return a boolean value. For instance:
greeting = 'hello'
In the code above, we added a dot (
.) after the variable name and called a function named
islower(). This syntax means that we invoke the
islower() function on the
islower() checks whether the string contains lowercase characters only. If this is the case, it returns
True, which is what happens with our code.