In this python if else program, we will check whether the given input is Boolean type or not.
Boolean expression:
A Boolean expression is a logical statement that is either TRUE or FALSE . Boolean expressions can compare data of any type as long as both parts of the expression have the same basic data type.
Steps to solve the program
- Take input through the user.
- Using an if-else statement check whether the given input is a Boolean type or not.
- Print the output.
num = True
if type(num) == bool:
print("True")
else:
print("False")
Output :
True