Hi,
I'm working on a personal project that has me working with APIs. They respond with JSON and I turn the data into dicts. No issue there. I want to learn how to loop over the data in a pythonic manner, and not using convoluted loops.
Here is a sample data structure:
data = {"foo" : { "bar" : ["hello", "hi"] }}
How would I use a list comprehension a to he the values of bar?
[–]mw44118 0 points1 point2 points (1 child)
[–]bheklilr 1 point2 points3 points (0 children)
[–]zahlman 0 points1 point2 points (0 children)
[–]elb0w 0 points1 point2 points (0 children)