Master Python
Change from the till
A market stall keeps its till entirely in pence, because pence are whole numbers and pounds are not. When somebody buys several of the same thing, the till needs to work out the change.
Write change, which is handed the amount the customer gave over, the price of one item, and how many of them they bought, all in pence. Return the change owed.
Input: paidPence = 1000, itemPence = 250, quantity = 3
Output: 250
Three coffees at 250p each cost 750p.
The customer handed over 1000p.
1000 - 750 = 250p of change.paidPence is between 0 and 100000.itemPence is between 0 and 10000.quantity is between 0 and 1000.Run your code to see how it does on the examples. Submit also runs the hidden cases.