Check whether the given input is Boolean type.

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
  1. Take input through the user.
  2. Using an if-else statement check whether the given input is a Boolean type or not.
  3. Print the output.
				
					num = True

if type(num) == bool:
    print("True")
else:
    print("False")
				
			

Output :

				
					True
				
			

Related Articles

check whether the given input is a complex type or not.

check whether the given input is List or not.

Leave a Comment