Difference between Positional , keyword, optional and required argument?
<p>I am learning about functions in python and found many good tutorials and answers about functions and their types, but I am confused at some places. I have read the following:</p>

<p>If function has <code>"="</code> then it's a keyword argument i.e <code>(a,b=2)</code>
If function does not have <code>"="</code> then it's positional argument i.e  <code>(a,b)</code></p>

<p>My doubts :</p>

<ul>
<li><p>What is the meaning of a required argument and an optional argument ? Is default argument also a keyword argument? (since because both contain "=")</p></li>
<li><p>Difference between the positional , keyword, optional and required
arguments?</p></li>
<li><p>python official documentation says that there are two types of arguments. If so, then what are <code>*args and **kargs</code> (I know how they work but don't know what they are)</p></li>
<li><p>how <code>*args</code> and <code>**kargs</code> store values? I know how <code>*args</code> and
<code>**kargs</code> works but how they store values? Does <code>*args</code> store values in
tuple and <code>**kargs</code> in dictionary ?</p></li>
</ul>

<p>please explain in deep.I want to know about functions because I am a newbie :)</p>

<p>Thanks in advance </p>

<ul>
<li>Optional arguments are those that have a default or those which are passed via *args and **kwargs. </li>
<li>Any argument can be a keyword argument, it just depends on how it's called.</li>
<li>these are used for passing variable numbers of args or keyword args</li>
<li>yes and yes</li>
</ul>

<p>For more information see the tutorial:</p>

<p><a href="https://docs.python.org/2/tutorial/controlflow.html#more-on-defining-functions" rel="nofollow">https://docs.python.org/2/tutorial/controlflow.html#more-on-defining-functions</a></p>

python python-2.7 python-3.x