title: How to understand variable-length argument in python function?
body: <p>I want to write my own sum function to get the sum of a  variable-length argument.</p>
  
  <pre><code>def myadd(*tuple):
      sum=0
      for element in tuple:
          sum=sum+element
      return(sum)
  </code></pre>
  
  <p>call method 1:</p>
  
  <pre><code>myadd(*(1,2,3,4))
  </code></pre>
  
  <p>It is the most formal way to call the function.no problem here.</p>
  
  <p>call method 2:</p>
  
  <pre><code>myadd(1,2,3,4)
  </code></pre>
  
  <p>It also can get the result,why?</p>
  
  <p>call method 3:</p>
  
  <pre><code>myadd((1,2,3,4))
  </code></pre>
  
  <p>error TypeError: unsupported operand type(s) for +: 'int' and 'tuple'.</p>
  
  <p>In my point of view,call 2 and call 3 can not be accepted by python,there are no * operator in the position of arguments?can you tell me the pricinple of the operation on python function ?</p>