5 Types of Arguments in Python
By : Rodrigo Scavazza
start>
1. THE Default Argument
What the default argument is about is that three variables are given that have to be in the code a,b,c in two of the three variables a random number is given and one does not have an added number, then they are all added but At the end I added a value to the variable that did not have a defined number.
2. THE keyword Argument
What the keyword argument does is when the function is activated, it is not guided by its position in the variable that is multiplied but rather by the name of the parameter to which a value was set, that is, each variable is allowed to specify which parameter. each value is assigned.
3. THE positional arguments
The positional argument is the complete opposite of the keyword argument because it is followed by the position where each variable was placed. For example, if we assign the number 3 to variable a and 4 to variable b, then the a, which would be 3, is taken the first position.
4. THE arbitrary positional arguments
What this function does is that it allows more variables or numbers to be accepted in the positional arguments, that is, if I defined only A as 1 and B as 4, I can put more numbers, for example, 6,7,2,3 without defining the arguments and it is also they will group into the "args" tuple so you can group all the arguments.
5. THE arbitrary keyword arguments
Unlike position, this one accepts a number or a variable, but now with arguments with keywords, I can define, for example, age=45, so both can represent the same thing as age and 45, in the example that I made was like k=2 and a=3.
How can you identify functions in social networks such as Instagram, Youtube, TikTok and SnapChat?
Mainly the functions are very important in social networks because they play with the experience and attractiveness that the social network has, to find the functions in social networks you just have to go to the main page of Instagram and you will see that there is a pattern on topics that you interest, what this function does is collect information like what food you like and puts it on the recommended list, or if you talk to someone often, the function algorithm will put your friends' posts first.
Does functions made difficult coding for you?
It was not difficult to make the code but it was difficult to understand what the 5 types of arguments in the Python function were for and what each one did because they all have a different function than the other.
! Thanks !