ExamGecko
Question list
Search
Search

Question 46 - JN0-223 discussion

Report
Export

Which Python operator is used to test if two variables are equal?

A.
!=
Answers
A.
!=
B.
==
Answers
B.
==
C.
%
Answers
C.
%
D.
=
Answers
D.
=
Suggested answer: B

Explanation:

In Python, the == operator is used to test whether two variables are equal. It returns True if the variables are equal and False if 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, and Option D (=) is used for assignment, not for testing equality.

Supporting

Reference:

Python Documentation on Operators: The official Python documentation covers the use of == for equality checks.

asked 18/09/2024
Derrick Roberson
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first