Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
def main(): # Get quantity in pounds quantity = int(input('Enter the quantity of coffee in pounds.')) # Calculate the cost of the coffee using if else structure if quantity >= 40: cost = quantity * 7.5 else: if quantity >= 20: cost = quantity * 8.75 else: if quantity >= 10: cost = quantity * 10.0 else: if quantity < 10: cost = quantity * 12.0 else: print('You did not enter a valid quantity.') # Calculate sales tax salesTax = cost * .07 # Calculate shipping fee if cost > 150.0: shippingFee = 0 else: shippingFee = quantity * 1.0 # Calculate Total Payable ttlPayable = cost + salesTax + shippingFee print('Cost of coffee = $', format(cost, ',.2f'), sep ='') print('7% Sales Tax = $', format(salesTax, ',.2f'), sep='') print('Shipping fee = $', format(shippingFee, ',.2f'), sep='') print('Total payable = $', format(ttlPayable, ',.2f'), sep='') main()
Join the community of 500,000 technology professionals and ask your questions.