Free Python programming for beginners- Tutorial- Functions - Def(*args, **kwargs) - Arbitary functions
Subscribe Here -https://www.youtube.com/@KeeshtuTechn...
#python#pythonprogramming #pythontutorial #pythonforbeginners #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish #pythonexecvseval #pythonexec()vseval() #pythonexec() #pythoneval() #youtubeviews #pythondef #pythondef() #pythonfunctions #pythonbreak #pythoncontinue #pythonpass #pythonzip #pythonunzip #pythonprintescapecharacter #pythonrepr() #pythonr
Please Captions on - Python in English, Python in Tamil, Python in Telugu, Python in Malayalam, Python in Chinese, Python in Japanese, Python in German, Python in Hindi, Python in French
-------------------------------------------------------------
[Music] welcome to technology platform so today we are going to see some in detail about the reusable function that is user defined functions we already
just printing hello world and then passing argument adding numbers so these kind of things we have seen it but these are all constant number for example if you pass two variables adding two variables then you can add only a plus b but I want to do like uh a plus b plus C or a plus b plus C plus d so not sure how users can provide the arguments sometimes one sometimes two sometimes three so this kind of things and all we need to concentrate so because of that there is a concept here is like arbitrary function so today we can save now I just open this so first thing
user can
given
one argument or two arguments or three arguments or even number of arguments we are not sure about them so for that to handling it we are going to use it star a r g star variable name and then
double star k w a r j s means
so variable we handle it sometimes user can give like course equal to
python
sometimes
[Music]
it's python comma chapter equal to 10 so can pass
related values for that we have to use a double star let's see practically so before that you just aware about that some default arguments so we have so many things let's see now f I can say like
my function Open Bracket I can say like number one comma number two here I will say like default I've used like this one 10. colon enter and then print [Music] number two now let's see I'll call this function my function
100 comma 100 I will pass this it will print 100 but I missed the second argument
so this is called
default argument
now second thing is like keyword argument so we have to use it like course name equal to Python and chapter equal to so like that we are going to pass it right so that now we'll see this keyword arguments we can say that kind
number one instead of that I will say like course name
chapters I will print
like this now I will call this function
here [Music] I'll say like python
it is printing no issue now what I am going to do here is that copy I can say like
chapters now if I pass it like this 10 comma python
then this is wrong sorry
if I pass like this
then this is wrong the course name is 10th the chapter is python this is not correct right so because of that we are going to use keyword here let's see I'm copying this
and then I can say like chapters the variable I am calling here chapters equal to 10 and course name equal to python
now let's see this you can get it the right value python 10. even though if you are providing the position is changed but we have provided the right keyword here and then mentioning this equal to like this so because of that it is looks like a keyword arguments we can say like
arbitrary arguments
so here we can see like star and then argument name a variable name we can say like let's see def my function I can just pass only I can say like numbers variable name colon
it is returning somebody given like three arguments
four arguments five arguments six arguments it is written see this somebody given like 10 arguments during run time
it should return so because of that we are going using this kind of star star and numbers we don't know how many arguments providing by the user sometimes it is a single sometimes double sometimes more than five six like that they are going to pass so we are not sure right so this kind of things we have to use it this kind of star and then uh variable name but let's see some example what we can see here is that can we pass some numbers in we can add add the numbers like how calculator is using for example some users they can do calculate like one plus two some users they come and say like one plus two plus three so how it works by using this argument arbitrary arguments let's see this add numbers
now let's see you are getting this is one one and this is so this is called arbitrary functions I hope you understand this let's see you in the next class with another more interesting topic thank you bye