Boolean

1. Explain boolean class.
Boolean values are a data type that represents one of two possible conditions: True or False.
2. What are the numerical equivalent values of True and False?
$1$ for True and $0$ for False
3. Do all objects in python have an associated boolean value?
Yes, all objects can either be true or false.
4. List down the main types of objects that has inherent False value.
  • None
  • False
  • 0 in any numeric type
  • Empty collections such as empty lists [].
5. What does True+True returns?
$2$ because True = 1
6. What is the use-case of bool() function.
To evaluate whether an object is True or False.
Last updated on 19 Nov 2023