-1
posts = []

#response = feedparser.parse(url)

# existing titles is equivalent to [x['title'] for x in posts]
existing_titles = []
for x in posts:
   existing_titles.append(x['title'])

What is this code suppose to do? How to append elements to an empty list within an empty list? I have seen this stackoverflow above that puts the append in every value of list, but im not still quite understanding what this code does because of x['title'], since posts is empty

1 Answers1

0

posts is a map of list with same key i believe, something like .

[{'title':'Test'},{'title':'this is test'},{'title':'en'},{'title':'tech'}]
LoahL
  • 2,404
  • 1
  • 9
  • 24