‘not’ Operator

Outputs True if operand is false. It complements the operand.

Suppose we take x=10, if we will write x>20 which is originally False, but the output will be True.

            x = 13
print(not x>20)
                x = 5
y = 6
print(not x>y)

Write a programme to  allow a person to musical show if a person is teenager or adult, and magic show if he is a teenager or kid and a horror show if he is a adult.


A teacher is free if they are talking, they are not busy, and they are not teaching. Given these three characteristics in the boolean variables talking, not_busy, and not_teaching, print True if the teacher is free, and False otherwise.

            talking = False
busy = True
not_teaching = True

print(talking and not  busy and not teaching)

'not' with numbers :

You can use the not operator to produce True if a number is zero, and False otherwise.

            score = 0
print(not score)