Introduction of Python
Getting Started with Python
Syntax in Python
Comment in Python
Variables in Python
Data Types in Python
Numbers in Python
Castings in Python
Strings in Python
Boolean in Python
Operators in Python
List in Python
Tuples in Python
Sets in Python
Dictionary in Python
if Else Statement in Python
While Loop in Python
For Loop in Python
Functions in Python
Lamba Function in Python
Arrays in Python
Classes and Objects in Python
Inheritance in Python
Iterators in Python
Scope in Python
Modules in Python
Dates in Python
Math in Python
JSON in Python
RegEx in Python
Try and Except in Python
User Input in Python
String Formatting in Python
Python me Comment kya hai?
Comment! kisi bhi programming language ka ek important part hota hai… Iska matlab yah nhi ki ise use karna mandatory hai, balki aap chahe to uska use nhi bhi karenge to bhi program ache se run karega.
Lekin suppose kariye ki apne 1000 lines of code likh liya hai aur next day koi aur iss code par kam karta hai, to use yah kaise samajh ayega ki kaun sa code kiske liye h?
Iska matlab yah hai ki iss tarah ki kai problems ho sakti hai jo kisi bhi work ko complicate karengi aur sath hi time bhi waste karengi. Issliye aap Comment ko kisi bhi tarah ki coding me use karna ek Mandatory rule bana le.
Comment ka best use Testing purpose me use hota hai, jisme comment execution ki process ko prevent karta hai means aap line by line uske result ka output jan sakte hain
Python me Comment Create kaise karen?
Python me comment create karne ke 2 tarike hain (# and “””sentence””” – 3 times double quote), aur ye depend karta hai ki hum kis type ka comment use karna chahte hain.Chaliye example ke through samajhte hain
Single Line of Comment :
#Add two numbers
c = 4 + 5
print (c)
Multi-line Comment :
#We want to add
#two numbers i.e. 6 & 7
d = 6 + 7
print (d)
aur aap muti-line comment ko kuch iss tarah se bhi likh sakte hain :
“””we are going to add
two numbers 6 & 7 “””
d = 6 + 7
print (d)