Just finished. Will add more later, but was a fun project to complete.
Guided Project_ Exploring Hacker News Posts.ipynb (8.6 KB)
Click here to view the jupyter notebook file in a new tab
Just finished. Will add more later, but was a fun project to complete.
Guided Project_ Exploring Hacker News Posts.ipynb (8.6 KB)
Click here to view the jupyter notebook file in a new tab
Hi @orichh congratulations for completing the project(Exploring hacker news posts).i have gone through your projects and have got few suggestions.
Otherwise ,to me, everything looks good including the comments, and am wishing you happy learning.
Hi @orichh,
Congratulations on completing the project! Your lines of code look good!
Here are a few comments for the room for improvement:
It is generally a good practice to add narration to your projects, such as introduction, goals, explanations for the lines of code, analysis and conclusion. It is good training for us to communicate our project with others (technical and non-technical audience), and we can use it in our portfolio for job application purpose.
Some comments are not really necessary. For example, # Import libraries needed
.
It is not necessary to use open_file.close()
.
For determining the average number of comments for ask_posts
and show_posts
, the lines of code are good. To make it even nicer and shorter, you can make a function and assign the post type
as a parameter into the function and call the function for ask_posts
or show_posts
later.
Well done for your good job! Happy coding!
thanks for the feedback!
I have a question - why wouldn’t we close the file? The courses state that we should always close the file after opening. thanks
I was not clear in my earlier message. It is a good practice to close a file after using it, although Python automatically closes a handle that drops out of scope, in case the programmer forgot. You can find a more detailed explanation here.