Which of the following characters is used for specifying a single line/inline…

2026

Which of the following characters is used for specifying a single line/inline comment in Python?

  1. A.

    $

  2. B.

    #

  3. C.

    """

  4. D.

    !

Attempted by 635 students.

Show answer & explanation

Correct answer: B

In Python, the hash symbol (#) is used to specify a single-line or inline comment. Any text following # on the same line is ignored by the interpreter.

Explore the full course: Rssb Senior Computer Instructor