# Exercise 1B # Tax calculator. # Each amount of money is expressed as a whole number of pounds. # # Author: David Watt. allowance = 10000 # tax-free allowance rate = 20 # tax rate (%) def taxable (income): "Return True iff income exceeds the tax-free allowance." return (income > allowance) def tax (income): "Return the amount of tax payable on income." if taxable(income): return (income - allowance) * rate // 100 else: return 0