title: Why am I receiving a type error for Python?
body: <p>"Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies." </p>
  
  <p>The line "num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val)" is what's giving me trouble but its a required line in the assignment.</p>
  
  <p>The error says:
  File "main.py", line 36, in 
  num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val)
  TypeError: 'NoneType' object is not iterable</p>
  
  <pre class="lang-py prettyprint-override"><code>if __name__ == '__main__': 
      input_val = int(input())
  
  num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val)
  
      num_dollars = input_val // 100
      input_val %= 100
      num_quarters = input_val // 25
      input_val %= 25
      num_dimes = input_val // 10 
      input_val %= 10
      num_nickels = input_val // 5
      input_val %= 5
      num_pennies = input_val
  
      if num_dollars &gt;1:
          print('%d dollars' % num_dollars)
      elif num_dollars ==1:
          print('%d dollar' % num_dollars)
      if num_quarters &gt; 1:
          print('%d quarters' % num_quarters)
      elif num_quarters ==1:
          print('%d quarter' % num_quarters)
      if num_dimes &gt;1:
          print('%d dimes' % num_dimes)
      elif num_dimes ==1:
          print('%d dime' % num_dimes)
      if num_nickels &gt;1:
          print('%d nickels' % num_nickels)
      elif num_nickels ==1:
          print('%d nickel' % num_nickels)
      if num_pennies &gt;1:
          print('%d pennies' % num_pennies)
      elif num_pennies ==1:
          print('%d penny' % num_pennies)
  if input_val &lt;= 0:
      print('no change')
  </code></pre>
  
  <p>The error says:</p>
  
  <p>File "main.py", line 36, in 
  num_dollars, num_quarters, num_dimes, num_nickels, num_pennies = exact_change(input_val)
  TypeError: 'NoneType' object is not iterable</p>