Question Detail

COS 102 If staments Objective Question

Question

According to the document, what is the primary purpose of the `=` operator in Python?
Options
A To check for equality between two values.
B To assign a value to a variable.
Correct Answer
C To indicate a logical AND operation.
D To signify 'greater than or equal to'.
Correct Answer

Option B is the correct answer.

Detailed Explanation

Page 14, 'Mistake #1: = vs ==', explicitly states that '= is for Assignment (giving a value)'.

Hint

Distinguish between assignment and comparison operators.

Question Info