Chalo surwat krte h dosto agar man lo apko apna naam print krana h ya fir kuch bhi print karana hai python mai to kaise kroge , so answer is by using a print statement , jaise mera naam Rishabh Gupta hai aur mujhe mera naam print karana hai
>>> print("Rishabh Gupta")
Rishabh Gupta
" maine yaha double inverted comma use kiya h ap single inverted comma ya triple inverted comma bhi use kr skte ho"
>>> print('Rishabh Gupta')
Rishabh Gupta
>>> print('''Rishabh Gupta''')
Rishabh Gupta
"ye code maine Python 3.7.5 shell mai run kiya hai ap ye code ko text editor ya fir Python IDE m run kr skte hai"
to yaha sawal uthta h ki ye text editor or IDE(Intergrated development environment) kya hai aur inme kya difference hai to mai apko bta do hm indono jagah mai apne python code ko run kr skte hai difference ye hai ki text editor mai ham code likhenge aur use run krenge command prompt m lekin agar hm Python IDE ka use krte hai to ap yahi code likhenge aur yahi run krenge aur IDE hme aur bhi badhiya feature provide krti h jaise code completion yani apka code auto complete ho jayega.
Best Python IDE -- Pycharm , Spyder
Python Comments
Comment wo line hoti hai jo python interpreter ignore krta hai
Comment two type ki hoti hai pahli hai Single line comment aur dusri hai Multi line comment
Single line comment
agar apko ek single line ko ignore krna hai to ap Single line comment use kr skte hai ,
# keyword ki madad se, aaiye dekhte hai
input - print("Hello world")
#hey maine apna pahla python code likha
output - Hello world
Multiple line comment
agar man lo apko ek se jada line ko comment krna h to ap multiple line comment ka use kr skte ho
, hm multiple line comment ka use (''' "') ki help se kr skte hai
example of multiple line comment
'''
Hello kya hall h dosto
python sikhne m maja aa rhi hai ki nhi
comment krke btao
'''
Comments
Post a Comment