Hacker posts: ask_posts, show_posts return 0s

Screen Link: https://app.dataquest.io/m/356/guided-project%3A-exploring-hacker-news-posts/3/extracting-ask-hn-and-show-hn-posts

Attached is my Notebook.

My code looks exactly like the solutions book.

However, I keep getting 0 when I check the lengths of ask_posts and show_posts.

Can you please help me out with this?

Thanks!
Basics.ipynb (4.3 KB)

Click here to view the jupyter notebook file in a new tab

Hello @souhasini.madhu,

The mistake is in the code cell In[1].
The correct line of code should be: hn = list(read_file).
Pass the read_file into the list() constructor not the opened_file.

I hope this solves the problem.

Thank you so much @doyinsolamiolaoye

@souhasini.madhu,

If it solves your problem, Kindly the reply as a solution.