I have implemented a "shopping basket" pricing library for a supermarket.
This is a component which if given a "basket" of products chosen by a customer, a "catalogue" of products available in a supermarket and a list of special offers, can calculate the price of goods including any applicable discounts. The basket component works out which offers are applicable to products and applying those offers to work out the final price.
For any given basket, catalogue and offers your solution should return the sub-total, discount and total, all accurate to at least two decimal places. Prices can be returned as floating point numbers.
I have used Python 3.6 to complete this test. I have created a class called ShoppingBasket which defines an init() method and other methods along with instances.