Ask or Show? Which one gets HN users commenting?

Mostly formatting and styling feedback, but any constructive criticism is welcome!

https://app.dataquest.io/m/356/guided-project%3A-exploring-hacker-news-posts/8/next-steps

Ask HN vs Show HN.ipynb (15.9 KB)

I also have it on my github if you would like to view it there!
https://tinyurl.com/yxoldldc

4 Likes

Hi @PriyankKrishnamoorth,

Congratulations on finishing this project.

There are a few things that I noticed which can be done differently too.

You have used similar code to print the list of list.

for post in hn:
    if index == 5:
        break;
    print(post)
    print("")
    index += 1

maybe you can use
hn[:5] to print first 5 rows of the list of lists.

Also these three lines of codes can be combined if you wish to do so.

print("Number of Ask HN posts: ")
print(len(ask_posts))
print("\n")

as

print("Number of Ask HN posts:", len(ask_posts), "\n")

Rest everything looks great. The markdown cell explanations are nice. So is the conclusion.

If you want to experiment more you can check pytz library so that you can use it to convert different timezones.
Hope this helps

1 Like

Thank you so much for the reply @jithins123!

Now that I look at it, I don’t why I used convoluted code to print the first five elements. Thank you for pointing it out for me. I’ll be sure to lookout for something like this in the future.

1 Like