Question 14
Back to Exercise
Which character lets you write several simple statements on one line, as in a = 1 ? b = 2?
- A a semicolon Correct
- B a comma
- C a colon
- D a period
Correct Answer: Option A
a = 1; b = 2 is legal Python, though PEP 8 discourages it. A comma would build a tuple; a colon starts a block.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!