Functions And Docstrings | Python Tutorials For Absolute Beginners In Hindi #23

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 503

  • @Sunshine9p
    @Sunshine9p 3 года назад +311

    The people who dislike don't know how many efforts go behind all these videos.... This is very nice explanation. Thanks Harry bhai!!

    • @aryankalra1358
      @aryankalra1358 3 года назад +2

      There is a reason why this guy has 7.3k likes over 69 dislike

    • @PawanKumar-ol5sl
      @PawanKumar-ol5sl 3 года назад +1

      What reason?

    • @Sunshine9p
      @Sunshine9p 3 года назад +1

      @@PawanKumar-ol5sl what do u mean?

    • @PawanKumar-ol5sl
      @PawanKumar-ol5sl 3 года назад +1

      What is reason of 7.3k likes pe 69 dislike ?

    • @PawanKumar-ol5sl
      @PawanKumar-ol5sl 3 года назад

      Aryan Kalra ne hi to kaha tha

  • @abhaykumarsharma7050
    @abhaykumarsharma7050 2 года назад +1

    Thanks!

  • @rishabhsharma329
    @rishabhsharma329 4 года назад +101

    You're exceptional harry. recommended you to brother of mine as well !

    • @raghavsharma6594
      @raghavsharma6594 3 года назад

      @Makai Asher lmaooo noob

    • @aakashsenkumar7488
      @aakashsenkumar7488 3 года назад +1

      you have same number of likes as harry's vid
      i meant the digits are same

  • @swapnil5332
    @swapnil5332 4 года назад +10

    Dear Harry Sir, i am Mechanical engineer and started learning AI from last month.. and started learning python from your videos.. it was amazing... i made this program for "basic Area calculator" by learning up to this video.. Thank you
    def square_area():
    sqside = float(input("enter side:
    "))
    if sqside == 0:
    print("value should be more than zero")
    return
    sq_area = sqside ** 2
    print("Area of Square is :", sq_area)
    return sq_area
    def rectangle_area():
    b = float(input("enter first side
    "))
    h = float(input("enter second side
    "))
    if b == 0 and h == 0:
    print("value should be more than zero")
    return
    rec_area1 = b * h
    print("Area of Rectangle is", rec_area1)
    return rec_area1
    def circle_area():
    r = int(input("enter radius
    "))
    circ_area1 = 3.142 * r * r
    print("Area of Circle is", circ_area1)
    return circ_area1
    sq = square_area
    ci = circle_area
    re = rectangle_area
    print("Choose your entity
    ","sq for square
    ","re for rectangle
    ","ci for circle")
    ans= input("Enter entity to find area
    ")
    while(ans):
    if ans== "sq":
    print (square_area())
    break
    if ans== "ci":
    print (circle_area())
    break
    if ans== "re":
    print (rectangle_area())
    break
    else:
    print("Wrong entity")
    break

    • @MuskanAroraTheVideocrafter
      @MuskanAroraTheVideocrafter 2 года назад

      thankyou so much , your single comment made me understand and do my cs project😍🥰🤩which i couldnt complete past few weeks🥲😭

  • @r.k.rajoria1172
    @r.k.rajoria1172 3 года назад +22

    I like the docstring facility in python. It is really helpful for professionals.

  • @axh_ketchum
    @axh_ketchum 4 года назад +24

    He is a ""Desi Programmer""
    Good job man....
    great Fan !!!!

  • @nitishdhiman4630
    @nitishdhiman4630 5 лет назад +13

    Bro you are genius ..
    teaching techniques are spectacular..
    docstring concept was really helpful..

  • @almadijayangaming834
    @almadijayangaming834 3 года назад +4

    Harry Bhai, I have watched many videos on return value and never really understood it. This video taught it to me very easily... Thank you so much!

  • @AadityaDwivedi
    @AadityaDwivedi 4 года назад +62

    Sir/Bro we 5 friends in a group started learning python from your videos . Really we realised we found coding so much easy .
    Please make videos on flutter .

    • @ravindrakaushik6245
      @ravindrakaushik6245 4 года назад +9

      You are genius bro. Hame bhi add kar lo apne group me.

    • @girishpandey3836
      @girishpandey3836 3 года назад +2

      @@ravindrakaushik6245 bhia hmako bhul gaye ham
      Tohre gar ke pecha to rhta hu

    • @mintuchoudhary3702
      @mintuchoudhary3702 2 года назад

      Bro you have notes

  • @wizminar
    @wizminar 3 года назад +6

    Bro thanks...... just completed 30 videos.....loved u r series :) it's my second language, i learned html and css now python

  • @abhishekvelera4780
    @abhishekvelera4780 4 года назад +10

    Never heard of doc strings but thanks to you for giving such knowledge

  • @vipultewariibm
    @vipultewariibm 4 года назад +44

    Hi Harry, I really appreciate your efforts for creating such wonderful tutorial and it will help a lot to many people who are aspiring developers or who is interested in learning Python. Adding to it, can you please also add the video regarding functions to show the example where it can also return more than one values as generally function return only one value but in Python we can return more than value. If you have already added this example in any future examples then it is fine. I am pasting an example in the comment section. I hope you don't mind it. Thanks in advance and again appreciating your efforts...
    #Multiple values can be returned as result from the function:
    def function3(a,b):
    """This function will return values for addition and substraction both for entered numbers"""
    add_result = sum((a,b))
    sub_result = a - b
    return add_result,sub_result
    add_value,sub_value = function3(7,5)
    print("Addition result is :",add_value,"Substraction result is :",sub_value)

    • @samme4294
      @samme4294 4 года назад

      what if i need a run time choice between number of returns i needed

    • @debasishsahoo3446
      @debasishsahoo3446 4 года назад

      Thanks bro

  • @sanasaleem4737
    @sanasaleem4737 3 года назад +1

    6:26
    def function2 (a, b):
    formula = a**2 + b**2 + 2*(a*b)
    return formula
    answer = function2(2, 4)
    print("answer is: ",answer)

  • @vikaasadityachouhan2902
    @vikaasadityachouhan2902 4 года назад +1

    def average(list_of_numbers,n):
    """Run the below program to find the average of numbers"""
    avg=(sum(list_of_numbers))/n
    return avg
    list_of_numbers = []
    print(average.__doc__)
    n = int(input("For how many number are we finding average for? "))
    i=0
    while i

    • @samme4294
      @samme4294 4 года назад +1

      good one Vikaas

  • @prernamittal2169
    @prernamittal2169 3 года назад +1

    @CodeWithHarry your videos are fully dependable for learning

  • @chinmaymathur2430
    @chinmaymathur2430 3 года назад +29

    "Harry"- A man with no haters.

    • @nitikasharma3623
      @nitikasharma3623 3 года назад +2

      No man you are wrong. White hat jr.

    • @itzz
      @itzz 3 года назад

      @@nitikasharma3623 🙁🤣🤣🤣🤣🤣hmm 🤣

  • @shreyank1558
    @shreyank1558 4 года назад +3

    This was greatly explained Thanks Man ... Applauded ₹40

  • @siddheshpanajkar660
    @siddheshpanajkar660 3 года назад +3

    Harry you are just amazing, and the way you explained docstring is just awesome.

  • @sarveshkumarnasare1420
    @sarveshkumarnasare1420 4 года назад +2

    Apke last words Bohot kuch sikha kr gye 🤩..thanks Harry ji 😊

  • @intesarpatel2107
    @intesarpatel2107 2 года назад

    Thank Harry sir. App ne bahot ache se samjhaya.

  • @terminalsocket3677
    @terminalsocket3677 2 года назад

    Thanks Harry Bhai. You are the best. I have watched many videos on return value and never could really understand it. But now i do.

  • @Jagjot_Singh
    @Jagjot_Singh 4 года назад +3

    Aree bhai best explaination 👍

  • @ssbigdata6732
    @ssbigdata6732 3 года назад +3

    Thank you harry for discussing Doc String

  • @shomendrapradhan9558
    @shomendrapradhan9558 5 лет назад +1

    Harry bhai , kya baat hai apne __doc__ very easily explain kiya. Thanks Harry bhai.

  • @rabbanali9782
    @rabbanali9782 2 года назад +1

    a = int(input("enter first number"))
    b = int(input("enter second number"))
    def rabban(a,b):
    """This is a function which will input two numbers and sum them and give ther summing result and there average."""
    print("rabban gives this answer:
    Sum of these two numbers is:",a+b)
    average ="And average of these two numbers is",(a+b)//2
    return average
    v=print(rabban(a,b))
    # print(rabban.__doc__)

  • @shxxxam.thakur
    @shxxxam.thakur 4 года назад +3

    Thanks Harry Bhai .. this really helps me a lot 😊

  • @garainfamily7431
    @garainfamily7431 3 года назад +2

    After coding in Scratch, its now very easy for me :D

  • @vedkumar3305
    @vedkumar3305 4 года назад +4

    def fun1(x,y,z):
    print("The answer is:",x+y+z)
    fun1(5,6,4)

  • @charanm1773
    @charanm1773 3 года назад +1

    Thanks, Harry Bhai for providing us with these python courses for free

  • @saikatrano3987
    @saikatrano3987 3 года назад

    Dil se shukriya harry bhai.. ❤️❤️❤️♥️♥️

  • @robosapien1413
    @robosapien1413 3 года назад +9

    Actually am mechanical engineer but I think (mechanical+Python =deadly combination ) for future ... thanks for these lectures

    • @sayanNITdgp2025
      @sayanNITdgp2025 2 года назад

      same for me

    • @robosapien1413
      @robosapien1413 2 года назад

      @@sayanNITdgp2025 you are from mechanical

    • @sayanNITdgp2025
      @sayanNITdgp2025 2 года назад

      @@robosapien1413 yupp

    • @robosapien1413
      @robosapien1413 2 года назад

      @@sayanNITdgp2025 seems like u have same interest ...robotics and mechanical .... Cool
      Can I get your fb id so that in future if get stuck ... I will take ur help

    • @sayanNITdgp2025
      @sayanNITdgp2025 2 года назад

      @@robosapien1413 yes🤩....
      My dream is Boston Dynamics

  • @Vv-xt9rz
    @Vv-xt9rz 2 года назад

    Ty so much sir bass apka he videos samjta hi u r really good

  • @sudarshanmhaisdhune1039
    @sudarshanmhaisdhune1039 4 года назад +1

    Ekdm mst content harry bhai.....

  • @girishchede9370
    @girishchede9370 4 года назад

    harry bhai apne website bohot acchi banayi hai .

  • @shreyashkashyap
    @shreyashkashyap 3 года назад +3

    Thank you! Was waiting for this video.

  • @skillenhancer5521
    @skillenhancer5521 3 года назад

    doc string concept was new for me.
    Thanks harry bhai .

  • @RohanDasRD
    @RohanDasRD 6 лет назад +9

    learned something new today! mloved it!

  • @gadhavijayvant
    @gadhavijayvant 3 года назад +2

    hello sir
    mene abhi 2021 - march me aapki series start ki hai
    great job
    aapane excercise 3 di wo complete ki hai
    SO jab hame guess the number chahiye mil jaye .........

  • @chainsawdude2087
    @chainsawdude2087 2 года назад +1

    def multilpyfunc(a,b):
    '''This function find the product of two given numbers '''
    m=a*b
    return m
    x=multilpyfunc(3,5)
    print(multilpyfunc.__doc__)

  • @ramkrishnayadav9335
    @ramkrishnayadav9335 2 года назад

    i m learning python through you.. sir 🙏🙏🙏❤️❤️

  • @kishanbhise4733
    @kishanbhise4733 2 года назад

    Great way of teaching Harry bhai

  • @professionaltailors1489
    @professionaltailors1489 4 года назад +1

    😍😍😍😍great man.....i love your videos ...u make easy to understand........really u are appreciatable

  • @ECHimanshuJungareEC
    @ECHimanshuJungareEC 3 года назад

    Thankuu harry bhai....ap great hooo

  • @shubham18goyal
    @shubham18goyal 2 года назад

    Thanks for crystal clear clearification... Keep posting

  • @pw-fanclub2826
    @pw-fanclub2826 4 года назад +3

    doc string is good thing I learn first time thank you

  • @tusshargoswami3443
    @tusshargoswami3443 3 года назад +1

    Bro before you start, if you share the syntax on your screen then explain with definition, it will give the actual understanding better for limited users

  • @shaganjotkaur269
    @shaganjotkaur269 3 года назад +2

    Thanks a lot and lots of respect 😊

  • @karishmasharma5571
    @karishmasharma5571 3 года назад +2

    Nice sir Thank you 🙏

  • @arpitagec9
    @arpitagec9 5 лет назад +30

    You talked about data science jargons like R square. Can you pls make a series to cover all stats concept required for ML.

  • @Heyaadi01
    @Heyaadi01 2 года назад +1

    Such a great video by a great sir.🤓

  • @rajankumar_37
    @rajankumar_37 5 лет назад

    Must video ._docstring_ naya sikhne ne mila

  • @ahmadfraz9715
    @ahmadfraz9715 4 года назад

    you are really professional teacher..

  • @abhinav1483
    @abhinav1483 2 года назад

    Great tutorial bhai!!! Thank You😀😀

  • @shankhadeepghosh6086
    @shankhadeepghosh6086 3 года назад +1

    User1=int(input (" Enter the number: "))
    User2=int(input (" Enter the number: "))
    def addition (user1,user2):
    Print("Your value is :",user1+user2)
    addition(user1,user2)

  • @HARSHYADAV-nx8ug
    @HARSHYADAV-nx8ug 5 лет назад +2

    upto the point.good work

  • @VishalSingh-oe3zx
    @VishalSingh-oe3zx 4 года назад +1

    Hello harry Bhai. here it is...
    print(function2.__doc__)
    i have reached on this video.

  • @nikki3682
    @nikki3682 4 года назад +2

    thank u so much for making this video

  • @mandvibhadouriya6850
    @mandvibhadouriya6850 4 года назад +1

    def function1(a,b):
    '''yes we are using function'''
    sum = a + b
    print(sum)
    return (sum)
    v=function1(12,2)
    print(v)
    print(function1.__doc__)
    output===
    14
    14
    yes we are using function

    • @royrings
      @royrings 2 года назад

      keep going champ!!!

  • @laliteshpandey344
    @laliteshpandey344 4 года назад +1

    def functions ():
    print ("Binod")
    Function ()
    Output= binod

  • @jayandhami7344
    @jayandhami7344 2 года назад

    love from Nepal harry bhai ❣ awesome video

  • @abhi_1441
    @abhi_1441 3 года назад

    This is some high class explanation..

  • @_itz._moin_
    @_itz._moin_ 2 года назад

    Excellent Tutorials

  • @Engineer9060
    @Engineer9060 3 года назад +1

    that moment he speaks beta ka nam sikandr or hota dubla patla sa... i literally launghed

  • @f-addicted7439
    @f-addicted7439 4 года назад +2

    One of the best tutorial of python❤️🙏

  • @rachitjain5598
    @rachitjain5598 4 года назад +16

    Thank you Harry for these awesome videos. Have 1 doubt in this video. Can we use this _doc_ string for the logic purpose in the program.
    For ex:
    if function1.__doc__ == "Harry":
    do something
    Can you please also tell the correct sequence of your playlists to be completed for Machine Learning course?

  • @yourknowadge2134
    @yourknowadge2134 4 года назад

    Thank you bhai
    Thousands of likes for your video

  • @programmingfacts6532
    @programmingfacts6532 3 года назад +1

    concept cleared

  • @pradeepchaursia656
    @pradeepchaursia656 2 года назад

    Hello Harry! I m preparing competitive exam, your tutorial is very helpful for me lots of thanks❤

  • @samme4294
    @samme4294 4 года назад +2

    def table_print(i):
    """ This function prints table of any number given as function input"""
    j = 1
    print("So you need the table of {}
    Here you go
    " .format(i))
    while(j

    • @thestrugglingguy6525
      @thestrugglingguy6525 4 года назад

      # a = 9
      # b = 8
      # c = sum((a, b)) # built in function
      def function1(a, b):
      print("Hello you are in function 1", a+b)
      def function2(a, b):
      """This is a function which will calculate average of two numbers
      this function doesnt work for three numbers"""
      average = (a+b)/2
      # print(average)
      return average
      # v = function2(5, 7)
      # print(v)
      print(function2.__doc__)

  • @ravisuman174
    @ravisuman174 3 года назад

    Thank you sir
    Hamre liai ye channel banana ke liai

  • @firefluxgaming9551
    @firefluxgaming9551 4 года назад +1

    bhai mene ek average finder of ten number banaya hai :-
    print("this is firefluxer's super average finder")
    print("enter the first number")
    n1=input()
    print("enter the second number")
    n2=input()
    print("enter the third number")
    n3=input()
    print("enter the fourth number")
    n4=input()
    print("enter the fifth number")
    n5=input()
    print("enter the sixth number")
    n6=input()
    print("enter the seveth number")
    n7=input()
    print("enter the eighth number")
    n8=input()
    print("enter the nineth number")
    n9=input()
    print("enter the tenth number")
    n10=input()
    d=(int(n1)+int(n2)+int(n3)+int(n4)+int(n5)+int(n6)+int(n7)+int(n8)+int(n9)+int(n10))/10
    print("Average(mean) ",end="")
    print("-")
    pls koi bhi like kar do agar acha laga to aur try karke run karke dekho agar ho sakey to harry bhai pls dil dedo

    • @Amina-hs9px
      @Amina-hs9px 4 года назад

      Good bhai

    • @sahilpunia2122
      @sahilpunia2122 4 года назад

      bhai apka program bilkul shi h bs last me apne jo print("-") ye likha h yha galti h. isko edit kr k shi kr lo...
      print(" ") iska matlab hota h jo bhi isme type kroge vo print ho jaega
      edit kr k aap print(d). likh do apka program correct ho jaega....

  • @foruse471
    @foruse471 3 года назад

    Love you Harry bhaiya 😘😘😘😘😘😘

  • @funnytbaadhrk5204
    @funnytbaadhrk5204 2 года назад

    def funck1 (a,b):
    """Theis line are very importen so do not try to delete(this line name dock string)
    this is the doc strin if you want print this line so write-print(function name,__doc__)"""
    #average=(a+b)/2
    #return average
    print(funck1. __doc__)

  • @rajivmura591
    @rajivmura591 5 лет назад +2

    Superb 🙏🙏🙏

  • @shivanshsoni379
    @shivanshsoni379 3 года назад

    thanks bro for teaching us.....

  • @umairy352
    @umairy352 2 года назад

    Ok Sir good ho gya👌

  • @ravikirankuppa9461
    @ravikirankuppa9461 4 года назад

    sir, i did,nt understand the topic,but your explanation was excellent

  • @ssubodh24
    @ssubodh24 4 года назад

    def myavg(n1,n2):
    """Thi is Doc String testing"""
    return(n1/n2)
    print("Enter numbers seperated by , to take average")
    a=list(map(int,input("Enter number:-").split(",")))
    b=float(myavg(sum(a),len(a)))
    print(myavg.__doc__)
    print("average of numbers entered is",b)

  • @areebcopycat6765
    @areebcopycat6765 2 года назад

    op bhai ek no explaination diye ho

  • @engineer_miss
    @engineer_miss 5 лет назад +2

    please make a series on machine learning.

  • @dreamerb1
    @dreamerb1 Год назад

    Thank you so much harry bhai❤❤

  • @onehourmusic5334
    @onehourmusic5334 2 года назад

    def functionname():
    {
    }
    print(fuctionname.__doc__)
    # in this way we print doc string of a function

  • @DakshuMachines
    @DakshuMachines 3 года назад +1

    Actually Harry bhai I am CS student and I started your python in one video , now I am at the point of Recursion but I want to learn all things like Data structures so I want to access your python playlist but from where I can start it??

  • @victor.novorski
    @victor.novorski 3 года назад +9

    You use light theme?
    👀
    🔥

  • @aliqamar5503
    @aliqamar5503 3 года назад

    just love and respect from Pakistan

  • @ravidesai12
    @ravidesai12 2 года назад

    aap best ho bhai

  • @anandgp07
    @anandgp07 3 года назад

    Thank you Harry bhai for the video

  • @aniketgoyal8044
    @aniketgoyal8044 7 месяцев назад

    def Average(a, b):
    """ths is a average function"""
    avg = (a+b)/2
    print(avg)
    Average(5, 7)
    print(Average.__doc__)

  • @umangaggarwal2017
    @umangaggarwal2017 4 года назад +1

    ############ Functions and Docstrings Tutorial #################
    # Function helps in code reuseability
    ##########################################
    ## Example of built in function
    a = 9
    b = 8
    # Sum is a inbuilt function in Python
    # takes tuple or list (more, general Iterables) as input
    c = sum((a,b))
    print(c) # Output : 17
    ##########################################
    ## Example of user defined function
    ## The keyword def introduces a function definition.
    # It must be followed by the function name and
    # the parenthesized list of formal parameters.
    # The statements that form the body of the function
    # start at the next line, and must be indented.
    def function1():
    print("Hello you are in function 1")
    function1() # Output : Hello you are in function 1
    ##### Functions with Parameter & Return Statement ####
    # The 'return' statement returns with a value from a function.
    # 'return' without an expression argument returns None
    # if no 'return' statement used in function ,
    # then function returns None

    print(function1())
    # Output : Hello you are in function 1 (due to function call)
    # : None (due to no return statement)
    ## Functions with parameters
    def function2(a,b):
    print("You are in function 2,","Sum :",a+b)
    function2(5,7)
    # Output :You are in function 2, Sum : 12
    def function3(a,b):
    average = (a+b)/2
    print("Average :",average)
    function3(5,7)
    # Output : Average : 6.0
    # If we want to store value calculated by function in a variable
    # We have to use return statement
    def function4(a,b):
    average = (a+b)/2
    # print("Average :",average)
    return average
    val = function4(5,7)
    print(val)
    # Output : 6.0
    ################ Doc strings ##################
    # Used to store information about function
    # """ Documentation """ or ''' Documentation '''
    # # This is not a comment but docstring ...
    # ...if written as first line in function
    # written elsewhere in function treated as comment
    def function5(a,b):
    '''This is a function which calculates average of two numbers'''
    average = (a+b)/2
    return average
    print(function5.__doc__)
    # Output : This is a function which calculates average of two numbers
    # docstring is helpful to know about functions
    # in diiferent imported modules
    # Also if we have large no. of functions
    # we can use docstring to know about function

  • @ankurmehta4325
    @ankurmehta4325 6 лет назад

    Bhai bhot ache se samjate ho aap

  • @syedfarhanali9527
    @syedfarhanali9527 4 года назад +2

    amazing bro !!!!

  • @mystery45454
    @mystery45454 4 года назад +1

    😊👏Nice

  • @coder.bihari
    @coder.bihari 3 года назад

    you are great sir

  • @VijayChauhan-Krishna
    @VijayChauhan-Krishna 3 года назад

    Thank you sir ❤️

  • @sahilvimal8795
    @sahilvimal8795 4 года назад

    Bhai tx yrr itna kuch hamare liye krne k liye

  • @cricketisourpassion6956
    @cricketisourpassion6956 2 года назад

    well done harry

  • @manmeetsingh6831
    @manmeetsingh6831 6 лет назад +1

    nice...easy explainations....

  • @billimew7496
    @billimew7496 3 года назад

    Docstring works great can be used to see the docstring by using CTRL button

  • @raunaksahu9059
    @raunaksahu9059 4 года назад +1

    Sir you are print("Very Very Good teacher🤞🤞")

    • @PawanKumar-ol5sl
      @PawanKumar-ol5sl 3 года назад +1

      Error no emoji can print in python .

    • @raunaksahu9059
      @raunaksahu9059 3 года назад

      @@PawanKumar-ol5sl oh! It's a my mistake ok

  • @muhammadzain2728
    @muhammadzain2728 4 года назад

    def func1():
    x = "Assignment"
    return x
    print(func1.__doc__)