In the answer below I’ll give some clues and leave you with some questions for you to answer by yourself. Let me know if you need more help.
It seems all titles are being appended to
other_posts, which in turns means that every
title is missing both the conditions (
title.lower().startswith("ask hn") and
Why would this be?
Try checking what
title looks like. You can run the following code (added a line to yours):
from csv import reader #importing the csv
opened_file = open('hacker_news.csv')
hn = list(opened_file) #assigning variable hn to the list
headers = hn #Isolating the headers row
hn = hn[1:] #Removing headers row
ask_posts = 
show_posts = 
other_posts = 
for row in hn:
title = row
if title.lower().startswith("ask hn"):
elif title.lower().startswith("show hn"):
print(title) # <-------- Added this line. See comments below.
title will hold the last value in the iteration, so you can at least inspect this value.
title look wrong to you?
Since title comes from
row, try printing
row as well. Does
row look wrong to you?
row comes from
hn, try inspecting a few of the elements of
hn. Do they look wrong to you? Why would they look like this? What was done differently from the solution notebook or other missions?
I hope this helps.