Python Programming - Conditional Statements - Discussion

Discussion Forum : Conditional Statements - General Questions (Q.No. 8)
8.
In Python, how can you represent the logical NOT operator in an if statement?
!=
not
<>
nor
Answer: Option
Explanation:

The not keyword is used as the logical NOT operator in Python. It is used to negate the truth value of a condition.

The != operator in Python is used for inequality comparison, not for logical negation. It checks if two values are not equal to each other. It's not used directly to represent logical NOT in an if statement.

Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.