<prompt> Vitu: - Mazao x2: 4.50 - Maziwa x6: 2.00 - Maziwa x1: 1.00Kuandika kazi ya mahesabu ya jumla ya gharama ya kikapu ununuzi  <response>: Here is a function written in Python that can calculate the total cost of a given shopping basket:pythondef total_costbasket: dict - float: Calculate the total cost of a shopping basket. :param basket: A dictionary containing items as keys and their respective price and quantity as values example: Apples: price: 4.50, quantity: 2, Eggs: price: 2.0, quantity: 6, Milk: price: 1.0, quantity: 1 :return: The total cost of the basket total_cost 0 for item in basket: price basketitem.getprice,0 quantity basketitem.getquantity,0 total_cost price quantity return roundtotal_cost, 2To use the function, pass the shopping basket as a dictionary to the function and it will return the total cost of the basket. Heres an example:python Create the shopping basket as a dictionarybasket Apples: price: 4.50, quantity: 2, Eggs: price: 2.0, quantity: 6, Milk: price: 1.0, quantity: 1 Calculate the total cost of the basketprinttotal_costbasketAfter running the above code, the output will be 15.0 which is the total cost of the basket. 