function with multiple arguments **args
<p>I am learning python and this is from </p>

<pre><code>http://www.learnpython.org/page/MultipleFunctionArguments
</code></pre>

<p>They have an example code that does not work- I am wondering if it is just a typo or if it should not work at all.</p>

<pre><code>def bar(first, second, third, **options):
    if options.get("action") == "sum":
        print "The sum is: %d" % (first + second + third)

    if options.get("return") == "first":
        return first

result = bar(1, 2, 3, action = "sum", return = "first")
print "Result: %d" % result
</code></pre>

<p>Learnpython thinks the output should have been-</p>

<pre><code>The sum is: 6
Result: 1
</code></pre>

<p>The error i get is-</p>

<pre><code>Traceback (most recent call last):
  File "/base/data/home/apps/s~learnpythonjail/1.354953192642593048/main.py", line 99, in post
    exec(cmd, safe_globals)
  File "&lt;string&gt;", line 9
     result = bar(1, 2, 3, action = "sum", return = "first")
                                                ^
 SyntaxError: invalid syntax
</code></pre>

<p>Is there a way to do what they are trying to do or is the example wrong? Sorry I did look at the python tutorial someone had answered but I don't understand how to fix this.</p>
