#a few simple programs to illustrate the use #of the if statement and its relatives #These will be progressively more complex #systems for computing income tax. #In this simple version, the tax is simply 15% of #the income over $20,000. However, we show how #to do this using the if..else construct, instead #of initializing the tax to 0. def tax2(): income = input("Enter income") if income>20000: tax=0.15*(income-20000) else: tax = 0 #we print the amount of tax as a whole dollar value print "Your tax is $",int(round(tax))