?
Which of the following character is used to give single-line comments in Python?
Answer & Solution
Correct Answer:
Option
B
In Python, the character used to give single-line comments is #.
Any text that comes after the # symbol on a line is treated as a comment and is ignored by the Python interpreter during execution. Single-line comments are commonly used for adding explanations, notes, or reminders within the code to improve readability and understanding.
Any text that comes after the # symbol on a line is treated as a comment and is ignored by the Python interpreter during execution. Single-line comments are commonly used for adding explanations, notes, or reminders within the code to improve readability and understanding.
Join the Discussion
Login to post a comment or share your explanation.
Login