Boolean Type
Boolean Type: bool.
How to set a boolean variable
12345a = True b = False print(a) print(b)
Boolean operator examples
| Operator | Returns |
|---|---|
>= | True if a number is greater than or equal to another |
<= | True if a number is less than or equal to another |
== | True if two values are equivalent |
!= | True if two values are not equivalent |
&& | True if both values are True |
! | True if the value is False |
1print(4 == 6)
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 1
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Ask me questions about this topic
Summarize this chapter
Show real-world examples
Awesome!
Completion rate improved to 2.7
Boolean Type
Swipe to show menu
Boolean Type: bool.
How to set a boolean variable
12345a = True b = False print(a) print(b)
Boolean operator examples
| Operator | Returns |
|---|---|
>= | True if a number is greater than or equal to another |
<= | True if a number is less than or equal to another |
== | True if two values are equivalent |
!= | True if two values are not equivalent |
&& | True if both values are True |
! | True if the value is False |
1print(4 == 6)
Everything was clear?
Thanks for your feedback!
SectionΒ 3. ChapterΒ 1