I'm reading this python book called "Python for software design" and it has the following exercise:
Suppose the cover price of a book is $24.95, but the bookstores get a 40% discount.
Shipping costs $3 for the first copy and 75 cents for each additional copy. What
is the total wholesale cost for 60 copies
bookPrice = 24.95
discount = .60
shippingPriceRest = .75
shippingPriceFirst = 3.00
totalUnits = 60
bookDiscountAmount = bookPrice * discount * totalUnits
shipping = shippingPriceRest * 59 + shippingPriceFirst
result = bookDiscountAmount + shipping
print 'The total price for 60 books including shipping and discount is: '
print 'Total price of the books is: ' + str(bookDiscountAmount)
print 'Total Shipping is: ' + str(shipping)
print 'The Total price is: ' + str(result)
There are only three things to change:
1) You duplicated the number of books: 60 and 59 both appear in the code. You shouldn't have 59 in there.
2) Print you results like this:
print 'The total price is: %.2f' % result
3) Usual Python convention is to name variables_like_this, notLikeThis.