Question: In Python, I have a list, List1, of several two element tuples that are as follows: (Item Name, Price). So, for example, List1 = [
In Python, I have a list, List1, of several two element tuples that are as follows: (Item Name, Price). So, for example, List1 = [ (Milk, 2.00), (Ice Cream, 3.00) ].
I also have another list, List2, of two element tuples that are as follows: (Serial Number, Quantity), where serial number refers to the element in List1. So, for example, List2 = [ (0,2), (1,1) ], where (0,2) refers to two things of milk and (1,1) refers to one thing of ice cream.
How can I use/call the tuples listed in List2 to call upon the corresponding tuples of List1, in order to output a final reciept?
Thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
