1>>> type(True)
2<class 'bool'>
3>>> type(true)
4Traceback (most recent call last):
5 File "<interactive input>", line 1, in <module>
6NameError: name 'true' is not defined
7
1>>> # The not operator is the opposite of it
2>>> not True
3False
4>>> not False
5True
6>>> # The and operator is True only if both are are true
7>>> True and True
8True
9>>> False and True
10False
11>>> False and False
12False
13>>> # The or operator is True if either of them are true
14>>> True or True
15True
16>>> False or True
17True
18>>> False or False
19False
1#The Python Boolean type is one of Python's built-in data types. It's used to represent the truth value of an expression.
2#in this code if you're age is under 13 than a massage will tell you that you are not able to sign up
3Name = input("Povide your name : ")
4Email = input("Provide your email : ")
5age = input("Provide your age : ")
6if age < "13":
7 print("you are not able to sign up")
8else:
9 if age > "13":
10 print("you are able to sign up")
1#In programming you often need to know if an expression is True or False.
2#as you can see below
3a = 200
4b = 33
5
6if b > a:
7 print("b is greater than a")
8else:
9 print("b is not greater than a")
1The Python Boolean type is one of Python's built-in data types. It's used to represent the truth value of an expression. For example, the expression 1 <= 2 is True , while the expression 0 == 1 is False .
2