0
How do you solve the code practice of tuples in python intermediaire
I am à beginners in python. In the code practice we need to create à program for searching name and ùgé of the name input. We are supposed to output the name + is+ age only if it is found and Not found else. But as it is a list of tuples the for loop print not found before printing the right output. Even with the solution the same result are found. Now i am blocked on this code practice. Please help me.
2 Answers
+ 4
Hi! Please, show your code attempt.
0
Since we can't see your attempt, I'm not 100% sure what the problem might be, but I just revisited the practice question, and it's possible you might have an iteration issue. Since this is a list of tuples and not a dictionary, you have to iterate through the items in the list and see if what you're looking for is in them, not just in the list. Hope this makes sense.