#32 Python Tutorial for Beginners | Functions in Python

Поділитися
Вставка
  • Опубліковано 26 лип 2018
  • Check out our courses:
    Spring and Microservices Weekend Live Batch : bit.ly/spring-live-weekend
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : bit.ly/java-spring-cloud
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusko.com/
    Instagram : / navinreddyofficial
    Linkedin : / navinreddy20
    TELUSKO Android App : bit.ly/TeluskoApp
    In this lecture we are discussing:
    #1 What are functions?
    #2 Arguments in function
    #3 return statement in python
    #1
    -- A function is a block of code that performs a specific task.
    -- Functions are used to break down larger programs into smaller and more manageable chunks,
    making it easier to read, test, and debug code.
    -- Functions can take input arguments, perform operations on them, and return output values.
    -- To define a function in Python, you use the def keyword followed by the function name,
    input parameters (if any), and a colon. The function body is then indented and contains the code to be executed.
    Here's an example of a simple Python function that takes two arguments and returns their sum:
    def add_numbers(a, b):
    sum = a + b
    return sum
    add_numbers(4,5) # calling the function
    without calling the function cannot run
    #2
    Arguments in python
    -- whatever variable is used inside a function during the defining of the function is called a formal argument.
    -- whatever value you passed during the calling is called actual arguments.
    #3
    -- The return statement is used to exit a function and return a value.
    -- The return statement can be used to return a value from a function.
    -- The return statement can also be used to exit a function without returning a value.
    -- If the return statement is without any expression, then the special value None is returned.
    -- Functions without a return statement return None as their result.
    def add_sub(x,y):
    c = x+y
    d = x-y
    return c,d
    result1,result2 = add_sub(4,5)
    print(result1,result2)
    The above code defines a Python function called add_sub that takes two input arguments x and y. The function first adds x and y and stores the result in a variable called c. It then subtracts y from x and stores the result in a variable called d. Finally, it returns both c and d as a tuple.
    The function can be called with two arguments, as shown in the line result1,result2 = add_sub(4,5). This line assigns the values returned by the add_sub function to the variables result1 and result2, respectively. The print statement then outputs the values of result1 and result2 to the console.
    Github :- github.com/navinreddy20/Python-
    Python for Beginners :- bit.ly/3JOLQhl
    Java:- bit.ly/JavaUdemyTelusko
    Spring:- bit.ly/SpringUdemyTelusko
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com
  • Наука та технологія

КОМЕНТАРІ • 394

  • @chriscruz429
    @chriscruz429 4 роки тому +425

    I’ve learned more from his videos than two years of paid college classes.

    • @AdityaYadav-ky2ng
      @AdityaYadav-ky2ng 3 роки тому +31

      So, stop bunking classes 😂

    • @zapphireqvq8954
      @zapphireqvq8954 3 роки тому +15

      How about code with harry?

    • @chriscruz429
      @chriscruz429 3 роки тому +4

      Aditya yadav
      *Ba dum tsss

    • @chriscruz429
      @chriscruz429 3 роки тому +3

      Zapphire QvQ
      Haven’t checked his videos out, but I will though.

    • @sandysandy9254
      @sandysandy9254 3 роки тому +5

      @@zapphireqvq8954 code with harry talk so fast it is good i also follow him but he talk fast

  • @Steve-wo5ry
    @Steve-wo5ry 4 роки тому +84

    I could not understand what my teacher taught in 3 months, I am understanding in 10 minutes!
    Thank you very much sir, may God bless you!👍

  • @surampudiswetha6099
    @surampudiswetha6099 Рік тому +33

    Hello Sir, I never thought my brain would ever understand python this easy, thanks to you, wishing you health and happiness to you!!, also proud that I can add this to my skills as I have not learnt in my UG classes.

  • @ademolaodusanya5678
    @ademolaodusanya5678 2 роки тому +11

    Always coming back here after paid online lectures

  • @Mahi_452
    @Mahi_452 5 років тому +62

    you explained very well which simply means that I learning programming and your words are making me more fluent with English.THANKS YOU SO MUCH

  • @Mamurjon877
    @Mamurjon877 3 роки тому +11

    7:34 the best explanation I have ever heard to understand types of function

    • @billi2247
      @billi2247 2 роки тому

      Yeah !!!
      M impressed

  • @vidyasadansteptowardsenlig3579
    @vidyasadansteptowardsenlig3579 3 роки тому +7

    Sir , you are doing exceptionally good work for us who are beginners in this field.
    Your videos are really easily understandable .

  • @preethiyr4525
    @preethiyr4525 4 роки тому +15

    Very neat & clear explaination about Python functions Sir.
    Thank you.

  • @mdkhader3670
    @mdkhader3670 3 роки тому +8

    You are a phenomenal in explaining python concepts very well :)
    Nice to have a good tutor like you

  • @WorldUpdates4U
    @WorldUpdates4U 4 роки тому +4

    Sir I m telling you that your teaching skills is different from other it make me very easy to understand. Thanks a lot.

  • @mohammadkhanafer4847
    @mohammadkhanafer4847 2 роки тому +3

    Thank you for making the material so digestible, even for those of us who hate programming!!

  • @arju6996
    @arju6996 5 років тому +8

    English is not even this guys first language yet he can still teach better than my high school Comp Sci teacher. Thank you for the tutorials!

    • @misstahj5651
      @misstahj5651 5 років тому +1

      He teaches better than my college professor lmao

  • @subhayansinha4417
    @subhayansinha4417 5 років тому +8

    These videos r amazingly helpful and clearly express the topic. Really like em👍👍

  • @adamshaffi
    @adamshaffi 4 роки тому +3

    A big thanks for this video bro... Looked so many places to understand functions but found here.

  • @kisanmanila9317
    @kisanmanila9317 4 роки тому +2

    Hi Naveen, Your videos are very good and really helping to get confidence. I am working on corporate having 13 years of experience and worked only in infra structure side. So, not having experience of Coding. But want to switch to programming as well. thanks for help

  • @lucasvandelogt5126
    @lucasvandelogt5126 5 років тому +6

    Thank you for explaining! This definitely helped in my exam :)

  • @deepshikasingh984
    @deepshikasingh984 5 років тому +4

    Thank you so much navin sir.... Its fun to learn python... Ur videos makes codings interesting... 😍👌

  • @amit4994
    @amit4994 2 роки тому

    Thank you so much, sir. I have joined a course by google but I always watch your video for understanding more clearly.

  • @thetanix7850
    @thetanix7850 4 роки тому +6

    Sir your videos are very helpful thank you for making programming so easy 🔥

  • @mdfaaz1611
    @mdfaaz1611 Рік тому +1

    May God bless you and thanks for explaining in most accurate and simple way.🙂

  • @arihantratdiya319
    @arihantratdiya319 3 роки тому +4

    That's a great work done by you sir it's helping every one a lot for learning quickly python thank you so much sir 🙏🏻🙏🏻 it's also like a rivision for me because I learned python earlier but it's not that clear in my mind like you did now all the concepts and basics I learnt to see your great and very interesting videos thank you so much sir for making videos like this 🙏🏻🙏🏻😊

  • @gyanesh8410
    @gyanesh8410 4 роки тому

    Gr8 man!!!
    I had not been able to understand return by my school teachers but now u made things clear and v simple!😄👍

  • @sudhanshuklkrn
    @sudhanshuklkrn 3 роки тому +1

    This is fun and I am enjoying it. Sir....Thank you sooo much. You have made this even more interesting.

  • @gibranfahad6876
    @gibranfahad6876 3 роки тому +1

    thank you so much sir the way u explained functions in this session was simply awesome

  • @alexikamran7039
    @alexikamran7039 Рік тому

    Brother you make coding so much easy , you are gifted. Love from bangladesh!

  • @parasghanshala7309
    @parasghanshala7309 3 роки тому +2

    Sir, thanks for this video because I was having some doubts in function topic, but now all doubts are clear 😊

  • @siddharthchampia5674
    @siddharthchampia5674 4 роки тому +3

    Awesome job you're way better than my school teacher😍

  • @surajkiran636
    @surajkiran636 3 роки тому +1

    You are great sir
    You just made my first project within a min
    Print(“love you sir”)
    Love you sir , here it is

  • @b.sasikumar2141
    @b.sasikumar2141 3 роки тому

    Ur teaching lectures all have seldom to learn python sir tq sir for giving pleasureble cousre sir..... 👍👍

  • @jagadishs1086
    @jagadishs1086 4 роки тому +1

    Sir I'm ur big fan sir .....ur making the concept very clear and thank you soo much sir for awesome videos...♥️

  • @Cvsreddy-rn5st
    @Cvsreddy-rn5st Рік тому +2

    The way that ur teaching was amazing

  • @hbs1231
    @hbs1231 2 роки тому

    Finally, someone who can explain this clearly.

  • @mithunacharya5813
    @mithunacharya5813 Рік тому

    Thank you so much for teaching us on easiest way,sir much love!

  • @shahnwazalansari5937
    @shahnwazalansari5937 3 роки тому

    The way of your explanation outstanding and in point of view out of the world love you sir from button of my heart 💓 amazing 👌

  • @reddydc5562
    @reddydc5562 Рік тому

    absolutely well done, loved your video, like a knowledge injection into my brain.

  • @meenakshidas9984
    @meenakshidas9984 3 роки тому +6

    After finishing python tutorials it will not be the end, I will go through all of your tutorials this quarantine and make myself better... Thank you so much sir ❤️❤️

  • @khadarbabamohammad580
    @khadarbabamohammad580 2 роки тому

    I am really happy with your detail explanation...Thank You.

  • @gandalffury127
    @gandalffury127 14 днів тому

    I ve been trying to understand what return does for a while now nobody was able to explain it in such a way i would get it, you sir just did it! Thank you a thousand times! Like and sub!

  • @opinions.029
    @opinions.029 4 роки тому +7

    sir loved your gif right after the execution of add function 😜
    best teacher though 💯

  • @imamhussain4200
    @imamhussain4200 5 років тому +5

    Hi sir, In c execution starts from main(), in python execution starts from?

  • @hariteshkumar281
    @hariteshkumar281 4 роки тому +2

    you can also take input from the user rather than giving your own value that can make the code more user friendly

  • @standman007
    @standman007 5 років тому +2

    Copy book demo Navin. Really cool and perfect

  • @indradeepchowdhury9430
    @indradeepchowdhury9430 4 роки тому +3

    This is very helpful...... Thank you sir

  • @raghavendrabm6274
    @raghavendrabm6274 3 роки тому +1

    i feel really perfect this videos to learn python beginners

  • @ImKLRahul
    @ImKLRahul 3 роки тому

    Truly one word for u- ur gem this language... 😊

  • @varunkrishnaKyathanpally
    @varunkrishnaKyathanpally 4 роки тому +4

    You made it easy to understand, tq :)

  • @subhajitsaha7068
    @subhajitsaha7068 4 роки тому +1

    I like your video sir.Neat and clear explanation your examples are awesome .

  • @ashitshekhar847
    @ashitshekhar847 3 роки тому +1

    Hey Navin, thanks for your tutorials on python. This by far has been the easiest to understand videos on python for me.

  • @ridhwangani9444
    @ridhwangani9444 3 роки тому +2

    Thanks for the great explanation!

  • @gokulp4788
    @gokulp4788 4 роки тому +1

    Thank you so much sir.
    Very informative....
    subscribed

  • @thanigai2725
    @thanigai2725 3 роки тому +1

    Thank you sir for your valuable work.💫

  • @sanjeevashoka7948
    @sanjeevashoka7948 5 років тому +2

    thanks a lot. Sir also make video on some course related projects.....

  • @ritikasharma7849
    @ritikasharma7849 4 роки тому +2

    No one can explain like you🤟

  • @akywongster
    @akywongster 5 років тому +1

    This is one of the best explations if functions I finally understands functions easier. Thx so so much you’ve made gain so hope in python subbed

  • @kalyantummanapalli3800
    @kalyantummanapalli3800 4 роки тому +12

    Hi Naveen,
    Here I have one query, i.e. how can I create a function on data frame( using columns ) for the calculations.
    Thanks.

  • @davidanamunda6766
    @davidanamunda6766 3 роки тому +1

    THANKYOU VERY MUCH THIS VIDEO HAS REALLY HELPED ME

  • @syedmohammedhayath6428
    @syedmohammedhayath6428 Рік тому

    Just Lovely! You're the light

  • @moazelsawaf2000
    @moazelsawaf2000 5 років тому +8

    Thanks a lot sir ❤

  • @bharathreddy6208
    @bharathreddy6208 4 роки тому +62

    I'm expecting some more clarification on "return".

    • @collinsouma283
      @collinsouma283 4 роки тому +3

      Its confusing. Solution == check your indention

    • @huntersparky7446
      @huntersparky7446 4 роки тому +16

      print just simply prints the output but return process the value which you can store in a var

    • @yingbowang3068
      @yingbowang3068 4 роки тому +3

      clear & easy to understand! a mid age mom with 2 kids never touched program can understand.
      hope have some examples to know better how to use in real life.
      the internet resources always too basic or too complex for a nut like me ...thanks a lot :D

    • @MrAnandhasanker
      @MrAnandhasanker 4 роки тому +3

      Print function only print cannot assign
      Return functions print and also can assign variable to it

  • @amruthasankar3453
    @amruthasankar3453 Рік тому +1

    Reallyyyy....superbb class❤️❤️❤️❤️❤️❤️❤️🤩🤩🤩🤩🤩🔥🔥🔥🔥🔥interesting...too...,the way of your explanation is.....really simple and humble so everyone can understand those topics very easily😍😍😍😍god bless you sir🙌🙌🙌🙌god bless you more and more😊🌸🌸🌸

  • @cherulast7998
    @cherulast7998 4 роки тому

    it was perfect bro. it was easy but better to add with complex also

  • @RahulGupta-ly2uu
    @RahulGupta-ly2uu 6 років тому +3

    I always get something from your videos
    Sir just tell me in python always i have seen that in the function arguments there is always a self keyword used
    why it is used?
    I think u should teach a self usage in next video.
    Babye.....

  • @sanju-lb9rn
    @sanju-lb9rn 2 роки тому

    glad i found your video , helped me a lot

  • @Alberta_Farmer
    @Alberta_Farmer Рік тому

    Further Enlightenment every ten minutes I gain when my attention I give to you))))

  • @sathyaprasanna8457
    @sathyaprasanna8457 4 роки тому +1

    thank you so much sir for teaching us.

  • @Thodapod
    @Thodapod 6 років тому +1

    nice -useful video .Thanks a lot sir..

  • @shazs8178
    @shazs8178 4 роки тому

    really the way you explain is Splendid

  • @amaniganza1154
    @amaniganza1154 4 роки тому +2

    thanks Navin it is clear

  • @natriumguy8537
    @natriumguy8537 3 роки тому +1

    This was a super amazing video.

  • @kishankini3406
    @kishankini3406 3 роки тому +1

    Sir, make an video on various plugins in PyCharm it should be useful.

  • @waqassalii1558
    @waqassalii1558 3 роки тому +1

    sir great job !!!!! thanks a lot ...

  • @NaveenKujur-eo5vt
    @NaveenKujur-eo5vt 4 роки тому +2

    Plz can u explain that
    In one function we have two Def
    And how it works

  • @deepika.r8098
    @deepika.r8098 4 роки тому +3

    Thank you sir very useful video

  • @vakhariyajay2224
    @vakhariyajay2224 Рік тому

    Thank you very much. You are a genius.

  • @225vikrant3
    @225vikrant3 4 роки тому +2

    Yo man you are cool and your explanation direct into head !!😉🙋 great !!

  • @shaziamohdsajimshagufta65
    @shaziamohdsajimshagufta65 3 місяці тому

    Thank you sir! you teach with simple way i learned😊

  • @Thefreesoul841
    @Thefreesoul841 5 років тому +2

    Very Interesting Videos on python

  • @yanamalasankar9389
    @yanamalasankar9389 5 років тому +1

    Super video Siru Thai is very helpful myself

  • @nomanulhaq6601
    @nomanulhaq6601 2 роки тому

    very helpful and easy to understand video

  • @harsiddhisinghdev4650
    @harsiddhisinghdev4650 6 років тому +3

    Waooo sir thankuuuuuu for awesome tutorial

  • @fareedsk6955
    @fareedsk6955 3 роки тому

    Thanks for suggestion at end

  • @vallabhaipatel9757
    @vallabhaipatel9757 6 років тому +3

    Can we get arguments in array and use them

  • @swagathbittu6963
    @swagathbittu6963 5 років тому +1

    Hai Sir,
    I heard Java is going to Licensed version from Jan19. Is it correct?

  • @danielkamau8436
    @danielkamau8436 4 роки тому +1

    excellent sir blessing upon u

  • @Sachin_-qs6he
    @Sachin_-qs6he 2 роки тому

    excellent knowledge thank you sir

  • @samarthasam2928
    @samarthasam2928 2 роки тому

    I am learning urs teaching so amazing😍

  • @kirankumar-re4yg
    @kirankumar-re4yg 4 роки тому +2

    Its really Awesome

  • @mirmeraj5703
    @mirmeraj5703 5 років тому +1

    Super amazing video.

  • @astridcifuentes6633
    @astridcifuentes6633 4 роки тому +6

    finally, I could understand. Thank youuuuuuu

  • @bryanpaderes8963
    @bryanpaderes8963 6 років тому +1

    great explanation sir!

  • @preetisingh2008
    @preetisingh2008 2 роки тому

    You are amazing.. Your explainations are more better then the school PDFs

  • @ankitchetri2968
    @ankitchetri2968 3 роки тому +1

    Thank u sir for existing

  • @MsVulgar
    @MsVulgar 6 років тому +3

    Awesome 👍

  • @PravinKumar-fc1ef
    @PravinKumar-fc1ef 4 роки тому +1

    What if I import numpy and then create a function of multiplication of two matrix and then call. It will work?

  • @aaronfisher5989
    @aaronfisher5989 2 роки тому

    Thank you very informative

  • @sanjaisrao484
    @sanjaisrao484 2 роки тому

    Exellent explaination of return

  • @HARPREETKAUR-jv7ek
    @HARPREETKAUR-jv7ek 4 роки тому +3

    Thank you sir 😻

  • @ashishsinha8893
    @ashishsinha8893 6 років тому +5

    Sir when u upload next videos sir my interview are near

  • @martinkaspar5095
    @martinkaspar5095 3 роки тому +1

    hi there _ great stuff - it would be more great if we do it in jupiter. But again - you did a great job

  • @nikhilhp5257
    @nikhilhp5257 5 років тому +3

    how to take input from the user in matrix format