Collecting only the authors from a list of posts
Write code · Basic · §10.2 A building loop in one line
This is a list of dictionaries. Each dictionary holds the author and the number of likes of one post. Use a list comprehension to make a new list of only the author names, in their original order, and store it in authors.
Starter code
posts = [
{"author": "mina", "likes": 120},
{"author": "jun", "likes": 45},
{"author": "sora", "likes": 300},
]Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.