In Python, the==operator is used to test whether two variables are equal. It returnsTrueif the variables are equal andFalseif they are not.
Option B (==)is correct because it is the equality operator in Python.
Option A (!=)is used for inequality,Option C (%)is the modulus operator, andOption D (=)is used for assignment, not for testing equality.
Supporting References:
Python Documentation on Operators:The official Python documentation covers the use of==for equality checks.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit