Seedha content par jao
๐Ÿค– Python Hindi Bot
Namaste! Main Python Hindi Bot hoon ๐Ÿ
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
⇧
Python Hindi Logo
Python in Hindi | Programming Education

Python Comments in Hindi | Single-Line, Inline & Multi-Line Comments | Python Course Episode 16




Python Comments in Hindi | Complete Guide - Single-Line, Inline เค”เคฐ Multi-Line Comments

Python เคธीเค–เคคे เคธเคฎเคฏ เค†เคชเค•ो เคฌเคนुเคค เคธाเคฐी เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เคšीเคœें เค†เคคी เคนैं, เค”เคฐ เค‰เคจเคฎें เคธे เคเค• เคนै Comments (เคŸिเคช्เคชเคฃिเคฏां)। เค…เค—เคฐ เค†เคช เคเค• เค…เคš्เค›े เคช्เคฐोเค—्เคฐाเคฎเคฐ เคฌเคจเคจा เคšाเคนเคคे เคนैं, เคคो เค†เคชเค•ो Comments เค•ा เคธเคนी เคคเคฐीเค•े เคธे เค‰เคชเคฏोเค— เค•เคฐเคจा เค†เคจा เคšाเคนिเค। เค‡เคธ เคฒेเค– เคฎें เคนเคฎ Python Comments เค•े เคฌाเคฐे เคฎें เคตिเคธ्เคคाเคฐ เคธे เคœाเคจेंเค—े।

Python Comments เค•्เคฏा เคนैं?

Comments เคเค• เคช्เคฐเค•ाเคฐ เค•ी เคจोเคŸ्เคธ เคฏा explanations เคนोเคคी เคนैं เคœो เค†เคช เค…เคชเคจे เค•ोเคก เคฎें เคฒिเค–เคคे เคนैं। เคฏे Python Interpreter เคฆ्เคตाเคฐा execute เคจเคนीं เคนोเคคी เคนैं। Comments เค•ा เคฎुเค–्เคฏ เค‰เคฆ्เคฆेเคถ्เคฏ เคนै:

  • เค•ोเคก เค•ो เคธเคฎเคเคจे เคฎें เค†เคธाเคจी เคฒाเคจा
  • เค…เคจ्เคฏ developers เค•ो เค•ोเคก เคธเคฎเคाเคจा
  • เค•ोเคก เค•े logic เค•ो เคธ्เคชเคท्เคŸ เค•เคฐเคจा
  • เคญเคตिเคท्เคฏ เคฎें เค…เคชเคจे เคนी เค•ोเคก เค•ो เคธเคฎเคเคจे เคฎें เคฎเคฆเคฆ เค•เคฐเคจा

Python เคฎें Comments เค•े เคช्เคฐเค•ाเคฐ

Python เคฎें เคคीเคจ เคฎुเค–्เคฏ เคช्เคฐเค•ाเคฐ เค•ी Comments เคนोเคคी เคนैं:

1. Single-Line Comments (เคเค• เคชंเค•्เคคि เค•ी Comment)

Single-line comments เค•ो hash symbol (#) เค•े เคธाเคฅ เคถुเคฐू เค•िเคฏा เคœाเคคा เคนै। เคเค• เคชंเค•्เคคि เคฎें เคœो เคญी # เค•े เคฌाเคฆ เค†เคคा เคนै, เคตเคน comment เคฎाเคจा เคœाเคคा เคนै।

Syntax:

# เคฏเคน เคเค• single-line comment เคนै
print("Hello, Python!")  # เคฏเคน เค•ोเคก เค•ो execute เค•เคฐेเค—ा

เค‰เคฆाเคนเคฐเคฃ:

# เคฎेเคฐे เคช्เคฐोเค—्เคฐाเคฎ เค•ा เคถुเคฐुเค†เคค
name = "เคฐाเคœ"  # เคจाเคฎ เคตेเคฐिเคเคฌเคฒ
age = 25  # เค‰เคฎ्เคฐ เคตेเคฐिเคเคฌเคฒ

# เคจाเคฎ เค”เคฐ เค‰เคฎ्เคฐ เค•ो เคช्เคฐिंเคŸ เค•เคฐเคจा
print(f"เคจाเคฎ: {name}, เค‰เคฎ्เคฐ: {age}")

Output:

เคจाเคฎ: เคฐाเคœ, เค‰เคฎ्เคฐ: 25

2. Inline Comments (เค‡เคจเคฒाเค‡เคจ Comments)

Inline comments เคเค• เค•ोเคก statement เค•े เค…ंเคค เคฎें เคฒिเค–ी เคœाเคคी เคนैं। เคฏे เค‰เคธ particular line เค•े เคฌाเคฐे เคฎें เคœाเคจเค•ाเคฐी เคฆेเคคी เคนैं।

Syntax:

statement  # เคฏเคน เคเค• inline comment เคนै

เค‰เคฆाเคนเคฐเคฃ:

x = 10  # เคชเคนเคฒी เคธंเค–्เคฏा
y = 20  # เคฆूเคธเคฐी เคธंเค–्เคฏा
sum = x + y  # เคฆोเคจों เค•ो เคœोเคก़เคจा

print(sum)  # เคชเคฐिเคฃाเคฎ เคฆिเค–ाเคจा

Output:

30

เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เคจोเคŸ:

๐Ÿง‘‍๐Ÿ’ป Python Coding Lab

Python code likho, run karo aur practice karo — directly browser mein.