Blog

Comment in python in hindi - Bharosewale

Posted By Naveen Singh on 29 Mar 2023

python-program
python-me-comment-kya-hote-hai-in-hindi

 

Python में comment क्या होते हैं?( What are comment in Python?)

 

Comment in python in Hindi

Comment का use हम python code को समझाने के लिए करते है। Code को अधिक readable बनाने के लिए comment का use किया जा सकता है,

Code की testing करते समय execution को रोकने के लिए  comment का use किया जा सकता है।

 

Python में comment को create कैसे करें?( How to create comment in python?)

Comment in python example

Python में comment को हम hashtag(#) symbol से denote करते है। python इसे ignore करता है।

Example-:

# This is a python comment

print("Bharosewale")

Output-:

Bharosewale


 

Python में comment कितने प्रकार के होते हैं?( How many types of comment in python?)

Python में comment basically दो प्रकार के होते हैं-

1) single line comment

2) multiline comment

 

Python में Single line comment क्या होते हैं?(What are Single line comment in Python?)

 

Single line comment-:  Python में single line comment को हम hashtag (#) symbol के अन्दर लिखते हैं बिना किसी white space के लाइन के अंत तक।

एक से ज्यादा comment लगाने के लिए हम hashtag(#) symbol को हर एक line में लिखते है।

 

Python में multiline comment क्या होते हैं?(What are multiline comment in Python?)

Multiline comment-: Python में multiline comment का कोई syntax नही होता है।  Multiline comment को add करने के लिए हम  hashtag(#) symbol को हर एक line में insert करना

पड़ता है।

Example-:

#This is a python single

#Line comment

print("python")

 

Output-:

python

इस तरह से आप multiline string का भी use कर सकते हैं। और python string literals को ignore करता है जब तक की वो किसी variable में store न हो।

इसी तरह से आप multiline string(triple quote) अपने code में use करके अपने comment को लिख सकते हैं ।

Example-:

'''This is a multiline comment in

python using string '''

print("this is multiline comment")

Output-:

this is multiline comment

Note-: Python string literals को तभी read करता है जब तक वह किसी variable में assign हैं।

 

Conclusion
 

I Hope आपको Python में comment क्या होते है? comment python में कैसे work करता है, और  comment के types बारे में आपको जानकारी मिली होगी। यदि आपको कोई doubt है तो comment section में comment करके पूछ सकते हैं।


 

Comments



nenielm

We performed comprehensive kinetic, inhibition, and correlation analyses in human liver microsomes and experiments in expressed human cytochromes P450 P450s to identify clomid cycle

03/04/2023