Print out all the ages at once

hi, if I have a list of items in the list e.g…[[“John”,“24”],[“Harvey”,“22”],[“Nathan”,“19”],[“Jeff”,“17”]], how would I code so that it prints out all the ages at once efficiently? Thank you.

This question was covered in the forums a couple weeks ago. Will see if I can find the topic. Post this question in the appropriate topic category associated with the lesson. If this is homework, then post your question in the Corner Bar.

1 Like

this is a home investigation, so where can I find the forum?

List that contains the people who’s age is equal or younger

1 Like

however, the one before required the user to input the data and I need it to iterate through the list and print all the ages in one go without having to do repeated print functions, is that possible?

Sounds like a job for a “for loop”?

2 Likes

hi thanks I think I found the solution

Care to share what you came up with?

1 Like