I'm new to Python and I'm wondering how can I iterate over part of the keys in a list of dictionaries.
Suppose I have something like:
OrderedDict([('name', 'Anna'), ('AAA', '15'), ('BBB', '49'), ('CCC', '38')])
OrderedDict([('name', 'Bob'), ('AAA', '31'), ('BBB', '21'), ('CCC', '41')])
etc.
I need to retrieve and iterate over AAA, BBB, CCC (keys, not values), but:
- only one time (not repeating for every dict in the list, but once, e.g. only for Anna)
- skipping 'name', just those going after
- in reality, I have many more of these keys (more than 10), so the question is how to iterate and not hard code it
I'd be very glad if you could help
Thanks a lot!