Question Detail

COS 102 If staments Objective Question

Question

Which of the following relational operators correctly checks if two values are equal?
Options
A <code>=</code>
B <code>==</code>
Correct Answer
C <code>!=</code>
D <code>&gt;=</code>
Correct Answer

Option B is the correct answer.

Detailed Explanation

Page 10, 'Relational Operators', lists '==' as 'Equal To'. Page 14, 'Mistake #1: = vs ==', clarifies that '=' is for assignment and '==' is for comparison.

Hint

Remember the distinction between assignment and comparison in Python.

Question Info