#superkondit.py - Extended kondit.py def main(): menu = """ Welcome to the Konditorei. A) Guatemala $10.50 B) Bourbon $18.99 Orders over 40 lbs receive a 20% discount on coffee. Shipping is $0.86/lb + $1.50 overhead. """.strip() #Figure out which coffee brand = raw_input("What type of coffee? ") if brand == "A": coffee_rate = 10.50 elif brand == "B": coffee_rate = 18.99 else: print "That is not a valid selection." return #return ends the function, with no value #Set prices ship_rate = 0.86 ship_fixed = 1.50 print menu #Print menu and get order lbs = input("How many pounds would you like to order? ") if 0 < lbs <= 50: if lbs >= 40: #20% discount coffee_rate = coffee_rate * 0.8 #Compute and print total price = coffee_rate*lbs + ship_rate*lbs + ship_fixed print "Your total is $%.2f." % price elif lbs > 0: print "Sorry, we can only process order up to 50 lbs." else: print "You must order positive amounts." main()