Create a tuple of grocery shopping items:
total_price
=qty*price
(to be calculated).Calculate the grand total (total bill amount).
Identify the costliest and the cheapest item.
Here is the code:
grocery = (
('butter', 'maggi', 'T-Shirt', 'Chocolate', 'Sanitizer'),
(12, 10, 250, 80, 15),
(10, 5, 2, 2, 5),
()
)
merged_tuple = ((i[0], i[1], i[2],i[1]*i[2]) for i in grocery)
merged_tuple