Question: How do I add a separator (comma ) to a number so that it prints. see program below : packages = int(input('Enter the number of
How do I add a separator (comma ) to a number so that it prints. see program below :
packages = int(input('Enter the number of packages purchased: '))
cost = 99 * packages
discount = 0
if 10 <= packages <= 19:
discount = cost * 0.1
if 20 <= packages <= 49:
discount = cost * 0.2
if 50 <= packages <= 99:
discount = cost * 0.3
if packages >= 100:
discount = cost * 0.4
total = cost - discount
print('Discount Amount: $%.2f' % discount)
print('Total Purchase Amount: $%.2f' % total)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
