Python Tutorial for Beginners 21 - Python Functions

preview_player
Показать описание
In this Python Tutorial for Beginners video I am going to show How to use Functions in Python. So what is a Function ? Function is a group of statements within a program that perform as particular task. A Function Usually one task of a large program.
Functions can be executed in order to perform overall program task.There are two kinds of functions in Python, First are Built-in functions that are provided as part of Python - print(), type(), float(), max() etc. Second type are Functions that we define ourselves and then use (user defined functions). Functions Make you code Simpler, reusable i.e. write the code once and call it multiple times, easy to test and debug and results in faster development time.
So first we will discuss How to declare a function in python and then I will demonstrate a Python function example.
A void function:
Simply executes the statements it contains and then terminates.
A value-returning function:
Executes the statements it contains, and then it returns a value back to the statement that called it.Some functions give back a value; others do not. If a function gives back a value, this is referred to as “returning” the value.

#PythonTutorialforBeginners #ProgrammingKnowledge #LearnPython #PythonCourse
★★★Top Online Courses From ProgrammingKnowledge ★★★

★★★ Online Courses to learn ★★★

★★★ Follow ★★★

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!
Рекомендации по теме
Комментарии
Автор

You sir, should do all the tutorials. You have a very calm speaking voice and you dont rush through explanations at the rate of 2000 words per minutes.
Thank you.

AndayRubin
Автор

i don't have words to say thanks, you are doing more than that.i am from japan.i am very appreciate your service and kindness

galaxyexpress
Автор

Clear, well-organized, and concise explanation. Thank you!

barbobrien
Автор

Your videos are best. I didn't study computer but now I'm learning languages. Please also upload python fx and gui videos.

gurejalectures
Автор

So if you use return statement inside the function for the passed values to be printed/displayed:
1. They calling code should be enclosed in a print function.
2. The calling code should be assigned a variable to it then print function to run the variable name.
Can argument be variable name and passed value be the value assigned ?

skylinecyber
Автор

Why did you change print with return at the 7:32 mark. If print was used there, wouldn't it give same result as in end? There would be no need to use print function in front of every sum

NithinKA