Python Tutorial for Beginners 13 - Defining 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.
★★★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!
Python Programming/Functions
python - function definition inside another function
python functions def
python classes
python round float
python return array
python function parameter
python if integer
python boolean
python tutorial
Рекомендации по теме
Комментарии
Автор

thanks for making python so eazy - i learnt it in 1 day

ajithmoharana
Автор

thank you!  this was really helpful :)

ACLAproductions
Автор

this video really helpful for me understood the function concept thank you

shaikmujaheed
Автор

Great video! You explained it very well!

LfomodDubstep
Автор

Really wel explained with some good examples. Thanks from the UK.

amazingict
Автор

what parameter & arguments ? this man is helping us to learn python with so much effort hands off!!! respect him
any way let me try to clear parameters is related to function definition ex: sum( int a, int b, int c) // inside paranthesis in C/C++ while arguments means sending data to function(in some text u would have heard passing arguments)
ex: sum(10, 12, 13) here 10, 12 and 13 are the arguments

ananthakrishnan
Автор

thanks for those people whose create this tutorial its very helpful for all people

prakashnarawade
Автор

I get extra word like 'none' after 'print name' but def function don't have anything like none after print statement. I use online python 3 editor to run the code

sasikala
Автор

I hv getting some prblem to run function programs

I put ur code but it resulting error

hri_designer
Автор

I am facing problem when passing string value. I'm getting answer in quotes

prateekbhojwani
Автор

How do we create a function using for loop and by also using user's range

streamsniper
Автор

def add(x, y):
return(x+y)

sum=add(56+87)
Traceback (most recent call last):
File "<pyshell#42>", line 1, in <module>
sum=add(56+87)
TypeError: add() missing 1 required positional argument: 'y'


hello sir, please this error means?

rashisrivastava
Автор

def print(name):
print(name)

tried to create built in function print, goes to recurrsion.

kunaldudeja
Автор

Without return we should call Method and with return we should call Function. I am right?

donekeykong
Автор

Hello Guys,
I am experiencing some difficulties with running my codes. I am currently using Windows 10 and my Python is running okay, but when it comes to executing my files, I dont know why it refuses to give me results. For example, when using while loops, I dont see the outcome at all. can anyone help me with this tiny issue please. your help is greatly appreciated.

ABMA
Автор

how to use this def function in real time pls send me a simple program sir

t.k.vijayaraghavareddy
Автор

ahelp. I am a beginner.Instead of repeating hello John and hello Mark and hello etc. Why can'tt these be done s a group with a one line code? Doesn't that make sense?

BN-hynd
Автор

sir, please describe tutorial 12 deeply

akabarijaimin
Автор

def sum(x, y):
print(x+y)

>>>sum(1, 2)

Is this wrong to print like this?
please help me.

harikachagantivlogs
Автор

Great video, but I think you meant colon, not semi-colon.

AlexBaillie
visit shbcf.ru