I'm still fairly new to Python and I'm learning about nested dictionaries and nested lists and how to extract values from them. I have an object called mylst
which has a list of tuples and each tuple has 3 items. Can someone please help explain the following to me so that I understand what is going on with the object test
?
Thank you.
test = [fruit for fruit in mylst if "Lemons" in fruit[2]]