Question Detail

COS 102 If staments Objective Question

Question

According to the 'The "If" Syntax' slide, what is the mandatory punctuation mark that must end an `if` statement line?
Options
A Semicolon (;)
B Comma (,)
C Colon (:)
Correct Answer
D Period (.)
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 6, 'The "If" Syntax' slide, explicitly states under 'The Colon:' that an if statement 'Must end with :'. This is a critical syntax requirement in Python.

Hint

Look for the punctuation mark mentioned under 'The Colon:' in the 'If' Syntax section.

Question Info