Which of the following character is used to give single-line comments in Python?
A. //
B. #
C. !
D. /*
Answer: Option B
Solution (By Examveda Team)
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.
Join The Discussion