Important Notice:

Single-Line Comment

Single-Line Comment

4 views 1 min read

 Single-Line Comment (सिंगल-लाइन कमेंट) :-

Single-Line Comment वह Comment होता है जो केवल एक Line (पंक्ति) में लिखा जाता है। Python में Single-Line Comment लिखने के लिए Hash Symbol (#) का उपयोग किया जाता है जिस Line की शुरुआत # से होती है, उसे Python Interpreter Execute नहीं करता।

यदि किसी Statement के बाद # लिखा जाए, तो उसके बाद का पूरा भाग Comment माना जाता है।

English

A Single-Line Comment is a comment written on a single line.

It starts with the Hash (#) symbol.

The Python interpreter ignores everything after the # symbol.

Example 1-

# This is a single-line comment

print("Python")
 
Example 2 -
x = 10   # Store value in x
print(x)
 

Related Notes