Contents

  1. sales_tax.py

sales_tax.py

# Compute the cost of an item, plus sales tax
# Demonstrate need for/use of format specifiers
# by Sara Sprenkle

SALES_TAX=.05  # the sales tax in VA

value = input("How much does your item cost? ")

with_tax = value * (1+SALES_TAX)

print "Your item that cost ($%.2f)" % value,
print "costs $%.2f with tax." % with_tax

Generated by GNU enscript 1.6.4.