#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 - Наука та технологія
I’ve learned more from his videos than two years of paid college classes.
So, stop bunking classes 😂
How about code with harry?
Aditya yadav
*Ba dum tsss
Zapphire QvQ
Haven’t checked his videos out, but I will though.
@@zapphireqvq8954 code with harry talk so fast it is good i also follow him but he talk fast
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!👍
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.
Always coming back here after paid online lectures
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
As he said he wo'nt be available. Rahul
7:34 the best explanation I have ever heard to understand types of function
Yeah !!!
M impressed
Sir , you are doing exceptionally good work for us who are beginners in this field.
Your videos are really easily understandable .
Very neat & clear explaination about Python functions Sir.
Thank you.
You are a phenomenal in explaining python concepts very well :)
Nice to have a good tutor like you
Sir I m telling you that your teaching skills is different from other it make me very easy to understand. Thanks a lot.
Thank you for making the material so digestible, even for those of us who hate programming!!
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!
He teaches better than my college professor lmao
These videos r amazingly helpful and clearly express the topic. Really like em👍👍
A big thanks for this video bro... Looked so many places to understand functions but found here.
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
Thank you for explaining! This definitely helped in my exam :)
Thank you so much navin sir.... Its fun to learn python... Ur videos makes codings interesting... 😍👌
Thank you so much, sir. I have joined a course by google but I always watch your video for understanding more clearly.
Sir your videos are very helpful thank you for making programming so easy 🔥
May God bless you and thanks for explaining in most accurate and simple way.🙂
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 🙏🏻🙏🏻😊
Gr8 man!!!
I had not been able to understand return by my school teachers but now u made things clear and v simple!😄👍
This is fun and I am enjoying it. Sir....Thank you sooo much. You have made this even more interesting.
thank you so much sir the way u explained functions in this session was simply awesome
Brother you make coding so much easy , you are gifted. Love from bangladesh!
Sir, thanks for this video because I was having some doubts in function topic, but now all doubts are clear 😊
Awesome job you're way better than my school teacher😍
You are great sir
You just made my first project within a min
Print(“love you sir”)
Love you sir , here it is
Ur teaching lectures all have seldom to learn python sir tq sir for giving pleasureble cousre sir..... 👍👍
Sir I'm ur big fan sir .....ur making the concept very clear and thank you soo much sir for awesome videos...♥️
The way that ur teaching was amazing
Finally, someone who can explain this clearly.
Thank you so much for teaching us on easiest way,sir much love!
The way of your explanation outstanding and in point of view out of the world love you sir from button of my heart 💓 amazing 👌
absolutely well done, loved your video, like a knowledge injection into my brain.
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 ❤️❤️
You got the job?
@@watchwithmantri no I'm a student
@@meenakshidas9984 okk you completed python??
@@watchwithmantri no
I am really happy with your detail explanation...Thank You.
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!
sir loved your gif right after the execution of add function 😜
best teacher though 💯
Hi sir, In c execution starts from main(), in python execution starts from?
you can also take input from the user rather than giving your own value that can make the code more user friendly
Copy book demo Navin. Really cool and perfect
This is very helpful...... Thank you sir
i feel really perfect this videos to learn python beginners
Truly one word for u- ur gem this language... 😊
You made it easy to understand, tq :)
I like your video sir.Neat and clear explanation your examples are awesome .
Hey Navin, thanks for your tutorials on python. This by far has been the easiest to understand videos on python for me.
Thanks for the great explanation!
Thank you so much sir.
Very informative....
subscribed
Thank you sir for your valuable work.💫
thanks a lot. Sir also make video on some course related projects.....
No one can explain like you🤟
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
Hi Naveen,
Here I have one query, i.e. how can I create a function on data frame( using columns ) for the calculations.
Thanks.
THANKYOU VERY MUCH THIS VIDEO HAS REALLY HELPED ME
Just Lovely! You're the light
Thanks a lot sir ❤
I'm expecting some more clarification on "return".
Its confusing. Solution == check your indention
print just simply prints the output but return process the value which you can store in a var
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
Print function only print cannot assign
Return functions print and also can assign variable to it
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😊🌸🌸🌸
it was perfect bro. it was easy but better to add with complex also
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.....
glad i found your video , helped me a lot
Further Enlightenment every ten minutes I gain when my attention I give to you))))
thank you so much sir for teaching us.
nice -useful video .Thanks a lot sir..
really the way you explain is Splendid
thanks Navin it is clear
This was a super amazing video.
Sir, make an video on various plugins in PyCharm it should be useful.
sir great job !!!!! thanks a lot ...
Plz can u explain that
In one function we have two Def
And how it works
Thank you sir very useful video
Thank you very much. You are a genius.
Yo man you are cool and your explanation direct into head !!😉🙋 great !!
Thank you sir! you teach with simple way i learned😊
Very Interesting Videos on python
Super video Siru Thai is very helpful myself
very helpful and easy to understand video
Waooo sir thankuuuuuu for awesome tutorial
Thanks for suggestion at end
Can we get arguments in array and use them
Hai Sir,
I heard Java is going to Licensed version from Jan19. Is it correct?
excellent sir blessing upon u
excellent knowledge thank you sir
I am learning urs teaching so amazing😍
Its really Awesome
Super amazing video.
finally, I could understand. Thank youuuuuuu
great explanation sir!
You are amazing.. Your explainations are more better then the school PDFs
in which class you are ?
Thank u sir for existing
Awesome 👍
What if I import numpy and then create a function of multiplication of two matrix and then call. It will work?
Thank you very informative
Exellent explaination of return
Thank you sir 😻
Sir when u upload next videos sir my interview are near
hi there _ great stuff - it would be more great if we do it in jupiter. But again - you did a great job
how to take input from the user in matrix format