RUVIDEO
Поделитесь видео 🙏

function in python

In this video you will learn about function in python.

What is a function?
A function is a name given to the block of code which only runs when it is called. A function contains group of related statements that performs a specific task. Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable. It avoids repetition and makes the code reusable.
You can pass data, known as parameter/argument, into a function.
A function can also return data as a result.
Creating a function
We use def keyword to create a function in python.
Example:
def greeting():
print("Hello, good evening")
Calling a function
To call a function, use the function name followed by parenthesis.
greeting()

Parameters/Arguments
Information can be passed into functions as arguments.
The parameters are specified in the parenthesis, after the function name. If we have more than one argument then they are separated by comma. The following example has a function with one argument(name), When we call the function we pass along a name , which is used inside the function to print greeting message with name.
def greeting(name):
print("Welcome Mr/Ms ",name)
Note: Arguments are often shortened to args in python.
Now while calling the above function we have to pass name.
greeting("Tarun Verma")
Parameter or argument
The terms parameter or argument can be used for the same thing: information that is passed into a function.
However, A parameter is a variable listed inside the parenthesis in the function definition , while argument is the value that is passed while calling the function.
In the above example name is the parameter and "Tarun Verma" is the argument.
Number of arguments
The function must be called with the correct number of the arguments. It means if your function have 1 parameter then you have to pass exactly 1 argument while calling the function, not more, not less will work.
For example, in the above function greeting() whenever we call it we have to pass one argument, if you do not pass any argument or pass more than one argument then it will be error.
greeting("Tarun Verma") #Is fine
greeting()#Is error
greeting("Tarun Verma","Arun Verma") #Is also error
Q. WAP to create a function which takes two numbers as argument and prints their sum.
Q. WAP to create a function which takes two numbers as argument and prints max.
#python_by_tarun_sir #tarun_sir #python #tarun_sir_python #python_video_43 #function_in_python #python_tutorial #create_function_in_python

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «function in python», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.