Examveda

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.

This Question Belongs to Python Program >> Introduction To Python

Join The Discussion

Related Questions on Introduction to Python