Boolean Variables & If Statement - Python for Absolute Beginners Course

Published: 15 April 2022
on channel: Programming With Nick
691
18

In this Python tutorial we are going to learn about Boolean variables and IF statements. So far we have learned about three types of things, that we can store in a variable, a String, an Integer, or a Float.

In this video we are going to learn about a 4th type. This type is called Boolean or Bool for short.

A Boolean variable can only have two possible values, either True or False.
In this example, I have created 3 variables, a String name, An Int age, and a float weight. Let’s create another variable that is going to be a Boolean variable.

Boolean variables are useful to represent things that only have two states, either on or off, or True or False. Let’s create a variable that will represent if a person is an adult or not. A person can either be an adult or not so a Boolean variable is ideal to represent it. So I create a descriptive variable name:

is_adult = True
or is_adult = False


Watch video Boolean Variables & If Statement - Python for Absolute Beginners Course online without registration, duration hours minute second in high quality. This video was added by user Programming With Nick 15 April 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 691 once and liked it 18 people.