<prompt> Ngola tšebetso ho bala kakaretso ea litšenyehelo tsa seroto sa ho rekaLintho: - Liapole x2: 4.50 - Mahe x6: 2.00 - Lebese x1: 1.00  <response>: Instruction in English: Write a function to calculate the total cost of a shopping basket . Response in English: 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. . Response in Sesotho: Mona ke tsebetso e ngotsoeng ka Python e ka khonang ho bala litšenyehelo tsohle tsa basketeng ea ho reka: python def total_costbasket: dict - float: Bala litšenyehelo kaofela tsa basketeng ea ho reka. :param basket: Buka e hlalosang mantsoe e nang le lintho tse kang linotlolo le theko ea tsona le bongata e le mohlala oa boleng: Apples: price: 4.50, quantity: 2, Eggs: price: 2.0, quantity: 6, Milk: theko: 1.0, quantity: 1 :return: Thepa eohle ea theko ea baskete total_cost 0 bakeng sa ntho e ka basketeng: theko basketntho.get price,0 quantity basketthem.fumanaquantity,0 total_cost theko palo ya poelo ya palokakaretso_chelete, 2 Ho sebedisa tshebetso, fetisa seroto sa ho reka e le bukantswe ho mosebetsi mme e tla khutlisa litšenyehelo tsohle tsa basketeng. Mohlala ke ona: python Theha seroto sa mabenkele joalo ka seroto sa bukantswe Liapole: theko: 4.50, quantity: 2, Eggs: price: 2.0, quantity : 6, Milk: theko: 1.0, quantity: 1 Bala litšenyehelo tsohle tsa khatiso ea basketetotal_costbasket Kamora ho sebelisa khoutu e kaholimo, tlhahiso e tla e be 15.0 e leng kakaretso ea litšenyehelo tsa basketeng. 