I am just about to start to use and learn python, and I am using the tutorials found on this website;

http://cscircles.cemc.uwaterloo.ca/

I am stuck on a problem found on

http://cscircles.cemc.uwaterloo.ca/2x-extra-practice/

called "payment calculator".

A credit card company computes a customer's "minimum payment" according to the following rule. The minimum payment is equal to either $10 or 2.1% of the customer's balance, whichever is greater; but if this exceeds the balance, then the minimum payment is the balance. Write a program to print out the minimum payment using min and max. Assume that the variable balance contains the customer's balance. Your program does not need to print the dollar sign.

Example 1: if your balance is 1000, then your program should print 21.

Example 2: if your balance is 600, then your program should print 12.6.

Example 3: if your balance is 25, then your program should print 10.

Example 4: if your balance is 8, then your program should print 8.

I am, as stated, a complete beginner; I am conscious of how simple this probably looks to you! What I have so far, is this;

Balance = 1000, 600 or 25, that is 1-3 on the list, this works out

- Code: Select all
`MinimumPayment = max(Balance * 0.021, 10)`

And, when it is 8, which refers to example 4;

- Code: Select all
`MinimumPayment = min(Balance, 10)`

However, I`m not sure how to express this in the code, to get the right results; note that this problem is supposed to be solved only by using "min" and "max" functions!

I`d love to get some input on this!

Best regards, Bjorn.C