Question Detail

COS 102 If staments Objective Question

Question

What is the crucial syntax element that must end an if statement's condition line in Python?
Options
A A semicolon (;)
B A period (.)
C A colon (:)
Correct Answer
D A comma (,)
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 6, 'The 'If' Syntax', highlights 'The Colon: Must end with :.' as a key syntax rule.

Hint

Missing this character is listed as 'Mistake #2' in the document.

Question Info