Question Detail

COS 102 If staments Objective Question

Question

What is the correct ending for the condition line of an if statement in Python syntax, according to the document?
Options
A semicolon (;)
B period (.)
C colon (:)
Correct Answer
D comma (,)
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 6, 'The 'If' Syntax', under 'The Colon', states: 'Must end with :'. This is a fundamental syntax rule in Python for control flow statements.

Hint

Review the 'The "If" Syntax' slide for specific punctuation requirements.

Question Info