Posted By Naveen Singh on 29 Mar 2023
python-program
Comment का use हम python code को समझाने के लिए करते है। Code को अधिक readable बनाने के लिए comment का use किया जा सकता है,
Code की testing करते समय execution को रोकने के लिए comment का use किया जा सकता है।
Python में comment को हम hashtag(#) symbol से denote करते है। python इसे ignore करता है।
Example-:
# This is a python comment
print("Bharosewale")
Output-:
Bharosewale
Python में comment basically दो प्रकार के होते हैं-
1) single line comment
2) multiline comment
Single line comment-: Python में single line comment को हम hashtag (#) symbol के अन्दर लिखते हैं बिना किसी white space के लाइन के अंत तक।
एक से ज्यादा comment लगाने के लिए हम hashtag(#) symbol को हर एक line में लिखते है।
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 हैं।
I Hope आपको Python में comment क्या होते है? comment python में कैसे work करता है, और comment के types बारे में आपको जानकारी मिली होगी। यदि आपको कोई doubt है तो comment section में comment करके पूछ सकते हैं।
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
Sitergusly
स्नान की बहाली
13/05/2023