Mission Link: https://app.dataquest.io/m/356/guided-project%3A-exploring-hacker-news-posts/3/extracting-ask-hn-and-show-hn-posts
ask_posts = 
show_posts = 
other_posts = 
for row in hn:
title = row
if title.startswith('ask hn'):
elif title.startswith('show hn'):
ask_posts and show_posts returning empty list
Question: Please, what am I doing wrong? Am getting empty list after appending title for each conditions
Hi Owojori. I think you may have missed this part of the instructions:
If the lowercase version of
title starts with
Unless the title already starts exactly with
ask hn (compared to “Ask HN” or “ask HN” with varying capital letters), it won’t get appended to the list. You’ll need to include a line of code that turns the title into an all lowercase version so that then it can check for the start of the title.
I hope that helps.
If I get you right.
You mean I should check for
startwith('ask HN') in another line of code??
There’s too many possible variations to check all of them. It’s a lot easier to just make the entire title lowercase using the
title = title.lower()
fell into same trap, thanks a lot for reaching here before me