A credit card company calculates a customer's "minimum payment" according to the following formula. The minimum payment is equal to either $10 or 19.9% of the customer's balance, whichever is greater; but if this exceeds the balance, then the minimum payment will be the balance. Write a program to print out the minimum payment using Python built-in functions min and max.
Example 1: If your balance is 1000, then your program should print "The minimum payment is 199".
Example 2: If your balance is 600, then your program should print "The minimum payment is 119.40".
Example 3: If your balance is 25, then your program should print "The minimum payment is 10".
Example 4: If your balance is 8, then your program should print "The minimum payment is 8".
balance = float(input("Enter your balance: "))
min_payment = max(10, 0.199*balance)
min_payment = min(balance, min_payment)
print("Your minimal payment is ${:.2f}".format(min_payment))
Comments
Leave a comment