LearnFrenzy
Sign in Take a free test

Python Basics and Syntax · Python Basics MCQ · Question 14

Several statements on one line Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links