For example:
list = [{"title_url": "joe_white", "id": 1, "title": "Joe White"},
{"title_url": "peter_black", "id": 2, "title": "Peter Black"}]
How can I efficiently loop through this to create:
Joe White, Peter Black
<a href="/u/joe_white">Joe White</a>,<a href="/u/peter_black">Peter Black</a>
Thank you.
The first is pretty simple:
The second requires something more complicated, but is essentially the same:
Both use generator expressions, which are similar to list comprehensions without the need for an extra list creation