#32 Python Tutorial for Beginners | Functions in Python

  Рет қаралды 1,020,207

Telusko

Telusko

6 жыл бұрын

Check out our courses:
Enterprise Java Spring Microservices: go.telusko.com/enterpriseJava
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com/udemyteluskosp...
Java:- go.telusko.com/udemyteluskojava
Java Spring:- go.telusko.com/Udemyjavaspring
Java For Programmers:- go.telusko.com/javaProgrammers
Python : go.telusko.com/udemyteluskopy...
Git : go.telusko.com/udemyteluskogit
Docker : go.telusko.com/udemyteluskodo...
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

Пікірлер: 396
@ademolaodusanya5678
@ademolaodusanya5678 2 жыл бұрын
Always coming back here after paid online lectures
@chriscruz429
@chriscruz429 4 жыл бұрын
I’ve learned more from his videos than two years of paid college classes.
@AdityaYadav-ky2ng
@AdityaYadav-ky2ng 4 жыл бұрын
So, stop bunking classes 😂
@zapphireqvq8954
@zapphireqvq8954 3 жыл бұрын
How about code with harry?
@chriscruz429
@chriscruz429 3 жыл бұрын
Aditya yadav *Ba dum tsss
@chriscruz429
@chriscruz429 3 жыл бұрын
Zapphire QvQ Haven’t checked his videos out, but I will though.
@sandysandy9254
@sandysandy9254 3 жыл бұрын
@@zapphireqvq8954 code with harry talk so fast it is good i also follow him but he talk fast
@Steve-wo5ry
@Steve-wo5ry 4 жыл бұрын
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 Жыл бұрын
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.
@Mahi_452
@Mahi_452 5 жыл бұрын
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
@adityabapat2070
@adityabapat2070 4 жыл бұрын
As he said he wo'nt be available. Rahul
@preethiyr4525
@preethiyr4525 5 жыл бұрын
Very neat & clear explaination about Python functions Sir. Thank you.
@vidyasadansteptowardsenlig3579
@vidyasadansteptowardsenlig3579 4 жыл бұрын
Sir , you are doing exceptionally good work for us who are beginners in this field. Your videos are really easily understandable .
@Mamurjon877
@Mamurjon877 3 жыл бұрын
7:34 the best explanation I have ever heard to understand types of function
@billi2247
@billi2247 2 жыл бұрын
Yeah !!! M impressed
@mdkhader3670
@mdkhader3670 3 жыл бұрын
You are a phenomenal in explaining python concepts very well :) Nice to have a good tutor like you
@subhayansinha4417
@subhayansinha4417 5 жыл бұрын
These videos r amazingly helpful and clearly express the topic. Really like em👍👍
@WorldUpdates4U
@WorldUpdates4U 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 жыл бұрын
Thank you for making the material so digestible, even for those of us who hate programming!!
@adamshaffi
@adamshaffi 5 жыл бұрын
A big thanks for this video bro... Looked so many places to understand functions but found here.
@lucasvandelogt5126
@lucasvandelogt5126 5 жыл бұрын
Thank you for explaining! This definitely helped in my exam :)
@arihantratdiya319
@arihantratdiya319 3 жыл бұрын
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 🙏🏻🙏🏻😊
@thetanix7850
@thetanix7850 4 жыл бұрын
Sir your videos are very helpful thank you for making programming so easy 🔥
@deepshikasingh984
@deepshikasingh984 5 жыл бұрын
Thank you so much navin sir.... Its fun to learn python... Ur videos makes codings interesting... 😍👌
@kisanmanila9317
@kisanmanila9317 4 жыл бұрын
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
@sudhanshuklkrn
@sudhanshuklkrn 3 жыл бұрын
This is fun and I am enjoying it. Sir....Thank you sooo much. You have made this even more interesting.
@gibranfahad6876
@gibranfahad6876 4 жыл бұрын
thank you so much sir the way u explained functions in this session was simply awesome
@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.
@mdfaaz1611
@mdfaaz1611 Жыл бұрын
May God bless you and thanks for explaining in most accurate and simple way.🙂
@parasghanshala7309
@parasghanshala7309 3 жыл бұрын
Sir, thanks for this video because I was having some doubts in function topic, but now all doubts are clear 😊
@arju6996
@arju6996 5 жыл бұрын
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 жыл бұрын
He teaches better than my college professor lmao
@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!😄👍
@jagadishs1086
@jagadishs1086 4 жыл бұрын
Sir I'm ur big fan sir .....ur making the concept very clear and thank you soo much sir for awesome videos...♥️
@reddydc5562
@reddydc5562 2 жыл бұрын
absolutely well done, loved your video, like a knowledge injection into my brain.
@varunkrishnaKyathanpally
@varunkrishnaKyathanpally 5 жыл бұрын
You made it easy to understand, tq :)
@indradeepchowdhury9430
@indradeepchowdhury9430 4 жыл бұрын
This is very helpful...... Thank you sir
@moazelsawaf2000
@moazelsawaf2000 5 жыл бұрын
Thanks a lot sir ❤
@Cvsreddy-rn5st
@Cvsreddy-rn5st Жыл бұрын
The way that ur teaching was amazing
@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 👌
@opinions.029
@opinions.029 4 жыл бұрын
sir loved your gif right after the execution of add function 😜 best teacher though 💯
@b.sasikumar2141
@b.sasikumar2141 4 жыл бұрын
Ur teaching lectures all have seldom to learn python sir tq sir for giving pleasureble cousre sir..... 👍👍
@khadarbabamohammad580
@khadarbabamohammad580 2 жыл бұрын
I am really happy with your detail explanation...Thank You.
@mithunacharya5813
@mithunacharya5813 Жыл бұрын
Thank you so much for teaching us on easiest way,sir much love!
@surajkiran636
@surajkiran636 3 жыл бұрын
You are great sir You just made my first project within a min Print(“love you sir”) Love you sir , here it is
@subhajitsaha7068
@subhajitsaha7068 4 жыл бұрын
I like your video sir.Neat and clear explanation your examples are awesome .
@siddharthchampia5674
@siddharthchampia5674 4 жыл бұрын
Awesome job you're way better than my school teacher😍
@gandalffury127
@gandalffury127 Ай бұрын
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!
@Thodapod
@Thodapod 6 жыл бұрын
nice -useful video .Thanks a lot sir..
@sanju-lb9rn
@sanju-lb9rn 2 жыл бұрын
glad i found your video , helped me a lot
@thanigai2725
@thanigai2725 4 жыл бұрын
Thank you sir for your valuable work.💫
@ridhwangani9444
@ridhwangani9444 3 жыл бұрын
Thanks for the great explanation!
@natriumguy8537
@natriumguy8537 3 жыл бұрын
This was a super amazing video.
@meenakshidas9984
@meenakshidas9984 3 жыл бұрын
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 ❤️❤️
@watchwithmantri
@watchwithmantri 3 жыл бұрын
You got the job?
@meenakshidas9984
@meenakshidas9984 3 жыл бұрын
@@watchwithmantri no I'm a student
@watchwithmantri
@watchwithmantri 3 жыл бұрын
@@meenakshidas9984 okk you completed python??
@meenakshidas9984
@meenakshidas9984 3 жыл бұрын
@@watchwithmantri no
@alexikamran7039
@alexikamran7039 Жыл бұрын
Brother you make coding so much easy , you are gifted. Love from bangladesh!
@bryanpaderes8963
@bryanpaderes8963 6 жыл бұрын
great explanation sir!
@amaniganza1154
@amaniganza1154 4 жыл бұрын
thanks Navin it is clear
@raghavendrabm6274
@raghavendrabm6274 3 жыл бұрын
i feel really perfect this videos to learn python beginners
@davidanamunda6766
@davidanamunda6766 3 жыл бұрын
THANKYOU VERY MUCH THIS VIDEO HAS REALLY HELPED ME
@hariteshkumar281
@hariteshkumar281 4 жыл бұрын
you can also take input from the user rather than giving your own value that can make the code more user friendly
@ImKLRahul
@ImKLRahul 3 жыл бұрын
Truly one word for u- ur gem this language... 😊
@waqassalii1558
@waqassalii1558 3 жыл бұрын
sir great job !!!!! thanks a lot ...
@cherulast7998
@cherulast7998 4 жыл бұрын
it was perfect bro. it was easy but better to add with complex also
@standman007
@standman007 5 жыл бұрын
Copy book demo Navin. Really cool and perfect
@gokulp4788
@gokulp4788 4 жыл бұрын
Thank you so much sir. Very informative.... subscribed
@sathyaprasanna8457
@sathyaprasanna8457 4 жыл бұрын
thank you so much sir for teaching us.
@yanamalasankar9389
@yanamalasankar9389 5 жыл бұрын
Super video Siru Thai is very helpful myself
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius.
@MsVulgar
@MsVulgar 6 жыл бұрын
Awesome 👍
@225vikrant3
@225vikrant3 4 жыл бұрын
Yo man you are cool and your explanation direct into head !!😉🙋 great !!
@sanjeevashoka7948
@sanjeevashoka7948 5 жыл бұрын
thanks a lot. Sir also make video on some course related projects.....
@harsiddhisinghdev4650
@harsiddhisinghdev4650 6 жыл бұрын
Waooo sir thankuuuuuu for awesome tutorial
@HARPREETKAUR-jv7ek
@HARPREETKAUR-jv7ek 4 жыл бұрын
Thank you sir 😻
@mirmeraj5703
@mirmeraj5703 5 жыл бұрын
Super amazing video.
@shazs8178
@shazs8178 4 жыл бұрын
really the way you explain is Splendid
@syedmohammedhayath6428
@syedmohammedhayath6428 Жыл бұрын
Just Lovely! You're the light
@imamhussain4200
@imamhussain4200 5 жыл бұрын
Hi sir, In c execution starts from main(), in python execution starts from?
@kirankumar-re4yg
@kirankumar-re4yg 5 жыл бұрын
Its really Awesome
@nomanulhaq6601
@nomanulhaq6601 2 жыл бұрын
very helpful and easy to understand video
@raihanation
@raihanation 4 жыл бұрын
yes, it's amazing
@hbs1231
@hbs1231 2 жыл бұрын
Finally, someone who can explain this clearly.
@fareedsk6955
@fareedsk6955 3 жыл бұрын
Thanks for suggestion at end
@ritikasharma7849
@ritikasharma7849 4 жыл бұрын
No one can explain like you🤟
@shaziamohdsajimshagufta65
@shaziamohdsajimshagufta65 4 ай бұрын
Thank you sir! you teach with simple way i learned😊
@deepika.r8098
@deepika.r8098 4 жыл бұрын
Thank you sir very useful video
@RahulGupta-ly2uu
@RahulGupta-ly2uu 6 жыл бұрын
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.....
@MANISHSHARMA-xk1su
@MANISHSHARMA-xk1su 6 жыл бұрын
Nice video sir....❤️
@amruthasankar3453
@amruthasankar3453 Жыл бұрын
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😊🌸🌸🌸
@samarthasam2928
@samarthasam2928 2 жыл бұрын
I am learning urs teaching so amazing😍
@aaronfisher5989
@aaronfisher5989 3 жыл бұрын
Thank you very informative
@user-kv6wy5sb3m
@user-kv6wy5sb3m 3 жыл бұрын
yaa we enjoy the video thanks so much
@chakrinithesh5142
@chakrinithesh5142 5 жыл бұрын
thank u very much ,sir
@danielkamau8436
@danielkamau8436 4 жыл бұрын
excellent sir blessing upon u
@Thefreesoul841
@Thefreesoul841 5 жыл бұрын
Very Interesting Videos on python
@ashiqulhassan3990
@ashiqulhassan3990 4 жыл бұрын
thank you for this video
@PrasannaKumar-zx7gr
@PrasannaKumar-zx7gr 4 жыл бұрын
Thank you sir!!
@nitinrawat7581
@nitinrawat7581 6 жыл бұрын
Very helpful
@Sachin_-qs6he
@Sachin_-qs6he 2 жыл бұрын
excellent knowledge thank you sir
@sanjaisrao484
@sanjaisrao484 2 жыл бұрын
Exellent explaination of return
@bharathreddy6208
@bharathreddy6208 4 жыл бұрын
I'm expecting some more clarification on "return".
@collinsouma283
@collinsouma283 4 жыл бұрын
Its confusing. Solution == check your indention
@huntersparky7446
@huntersparky7446 4 жыл бұрын
print just simply prints the output but return process the value which you can store in a var
@yingbowang3068
@yingbowang3068 4 жыл бұрын
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 жыл бұрын
Print function only print cannot assign Return functions print and also can assign variable to it
@susanshal5047
@susanshal5047 4 жыл бұрын
Nice explaination sir.
@tallentedhai4238
@tallentedhai4238 3 жыл бұрын
Your cartoon character was excellent sir😂😂
@sourabhsharma3027
@sourabhsharma3027 5 жыл бұрын
Wonderful explanation
@vipankumar5596
@vipankumar5596 3 жыл бұрын
Nice to watch
@jyotigupta-be9oy
@jyotigupta-be9oy 4 жыл бұрын
Thank you sir,
@sufiyanmogal1527
@sufiyanmogal1527 2 жыл бұрын
Nice Explanation Sir
@ankitchetri2968
@ankitchetri2968 4 жыл бұрын
Thank u sir for existing
@akywongster
@akywongster 5 жыл бұрын
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
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 436 М.
哈莉奎因以为小丑不爱她了#joker #cosplay #Harriet Quinn
00:22
佐助与鸣人
Рет қаралды 9 МЛН
World’s Largest Jello Pool
01:00
Mark Rober
Рет қаралды 112 МЛН
ТЫ С ДРУГОМ В ДЕТСТВЕ😂#shorts
01:00
BATEK_OFFICIAL
Рет қаралды 5 МЛН
Functions in Python | Introduction | Python for beginners #lec56
24:07
Jenny's Lectures CS IT
Рет қаралды 125 М.
Python Functions (The Only Guide You'll Need) #12
17:20
Programiz
Рет қаралды 567 М.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
MrBeast
Рет қаралды 114 МЛН
Python for Beginners - Learn Python in 1 Hour
1:00:06
Programming with Mosh
Рет қаралды 18 МЛН
How To Use Functions In Python (Python Tutorial #3)
14:55
CS Dojo
Рет қаралды 2,3 МЛН
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 393 М.
#20 Python Tutorial for Beginners | While Loop in Python
12:43
Telusko
Рет қаралды 1,6 МЛН
Python Functions | Python Tutorial for Absolute Beginners #1
30:34
Programming with Mosh
Рет қаралды 935 М.
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 7 МЛН
Новые iPhone 16 и 16 Pro Max
0:42
Romancev768
Рет қаралды 2,4 МЛН
Vision Pro наконец-то доработали! Но не Apple!
0:40
ÉЖИ АКСЁНОВ
Рет қаралды 603 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 9 МЛН