Boolean Numbers
The following data type is crucial for us; it helps check if a specific condition was satisfied.
Imagine that you want to store data about users who continued subscriptions after a trial period and who canceled.
The best way is to divide users into two groups: False if users canceled the subscriptions and True if one continued.
We can create a table where one boolean value (True or False) will correspond to the statuses of users' subscriptions. We will practice it in the next chapter.
There are two ways to define several conditions:
- With the 
orstatement: here, if at least one condition equalsTrue, the whole statement equalsTrue; otherwise, it is equal toFalse. Look at the examples: 
True or True = True
False or True = True
False or False = False
- With the 
andstatement: here, if at least one condition equalsFalse, the whole statement equalsFalse; otherwise, it is equal toTrue. Look at the examples: 
True and True = True
False and True = False
False and False = False
Obrigado pelo seu feedback!
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Pergunte-me perguntas sobre este assunto
Resumir este capítulo
Mostrar exemplos do mundo real
Awesome!
Completion rate improved to 2.08
Boolean Numbers
Deslize para mostrar o menu
The following data type is crucial for us; it helps check if a specific condition was satisfied.
Imagine that you want to store data about users who continued subscriptions after a trial period and who canceled.
The best way is to divide users into two groups: False if users canceled the subscriptions and True if one continued.
We can create a table where one boolean value (True or False) will correspond to the statuses of users' subscriptions. We will practice it in the next chapter.
There are two ways to define several conditions:
- With the 
orstatement: here, if at least one condition equalsTrue, the whole statement equalsTrue; otherwise, it is equal toFalse. Look at the examples: 
True or True = True
False or True = True
False or False = False
- With the 
andstatement: here, if at least one condition equalsFalse, the whole statement equalsFalse; otherwise, it is equal toTrue. Look at the examples: 
True and True = True
False and True = False
False and False = False
Obrigado pelo seu feedback!