Mixing keyword and default arguments in python 3.5.1
<p>I'm a newbie and taking an online python class through an online workbook. I can't seem to figure out how to get the output to display like the example shown:</p>

<p>Problem instructions:
Write a function number_of_pennies() that returns the total number of pennies given a number of dollars and (optionally) a number of pennies. Ex: 5 dollars and 6 pennies returns 506. </p>

<p>Here is what I have:</p>

<pre><code>def number_of_pennies(dollars = (),pennies=())

    return number_of_pennies
print(number_of_pennies(5, 6)) # Should print 506
print(number_of_pennies(4))    # Should print 400
</code></pre>

<p>Thanks to your help I just changed it to this:</p>

<pre><code>def number_of_pennies(dollars = 0,pennies=0):
    number_of_pennies= (dollars * 100) + pennies
    return number_of_pennies
print(number_of_pennies(5, 6)) # Should print 506
print(number_of_pennies(4))    # Should print 400
</code></pre>