Skip to main content

Python Boolean

Body

In this tutorial you will learn:

  • Boolean in Python
  • Boolean expressions
  • Importance of Boolean in programming.

Boolean in Python

Boolean is perhaps one of the most simple yet the most powerful data type not only in Python but in other programming languages as well. Boolean data type has either a value of True or a value of False. Even the keywords used in Python to define Booleans are True and False.

  1. myTrueBool = True 
  2. myFalseBool = False

They can also act like numbers in some scenarios such as in arithmetic operations. In that case 0 represents false and 1 represents true

Add new comment