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?
- A.
$
- B.
#
- C.
"""
- 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.