PREMIUM
๐Ÿ“š FPSC SST 2026 Preparation Group
Join Our WhatsApp Group for SST Past Papers & Mock Tests
โœ… Daily MCQs โ€ข ๐Ÿ’ก Expert Tips โ€ข ๐Ÿ“š Past Paper Discussion
Join Group โ†’

Which symbol is used for comments in Python?

A. //
B. /*
C. #
D. --
Correct Answer: C. #

In programming, comments are non-executable lines of code that developers include to make their code more understandable for themselves and others. They are ignored by the interpreter or compiler. Different programming languages use different symbols to denote comments.

For Python, the symbol used for single-line comments is the hash symbol.

The correct answer is C: #. In Python, any text following a '#' on a line is considered a comment and is not executed.

A: // is incorrect; this symbol is commonly used for single-line comments in languages like C++, Java, JavaScript, and C#. B: /* is incorrect; this symbol, typically paired with '*/', is used for multi-line comments in languages such as C, C++, Java, and JavaScript. D: -- is incorrect; this symbol is used for comments in languages like SQL and Ada, among others, but not Python.

Leave a Comment

Your email address will not be published. Required fields are marked *

Join Our WhatsApp Channel ×
Scroll to Top