python if not explaned 1

python if not explaned

#A demo of Python 'not' operator
x = 10
if not x > 10:
    print("not retured True")
    print("not retured False")

Here is what the above code is Doing:
1. We have a variable x with value 10.
2. We are checking if x is not greater than 10.
3. Since x is not greater than 10, the condition is True.
4. So, the code inside the if block is executed.
5. The output of the above code is:
not retured True

Similar Posts