This was a difficult project for me but I think that’s because I over complicated it for myself. I probably spent a total of 15 hours over the weekend on this including researching methods of stuff we haven’t learned yet. All info you will need is in the README.MD. Please check out my project and let me know how I did. Any and all constructive criticism is welcome!!
Hi Bsr5,
I want to commend you on this project, it is very well done. I can tell you put a lot of effort into this!
Here some constructive feedback.
- Consider copying everything wrote in US Medical Insurance Information.docx and paste it on the README.md file. Honestly, that is the purpose of the README.md file.
- There is a typo page 2, last paragraph, line 4: The
1sort_data_in_column()
function should besort_data_in_column()
. - According to PEP 8 – Style Guide for Python Code,
Use inline comments sparingly. Inline comments are unnecessary and in fact distracting if they state the obvious
My friend, those inline comments of yours are egregious , (said jokingly).
4. Finally, consider creating one more file, main.py, and import all of your functions ad execute your code in it, to help organize your project. For example:
# main.py
from Extra_cost import column_data, sort_data_in_column, sum_of_column
def main():
non_smokers_gathered = column_data("non_smokers_data.csv", "charges")
smokers_gathered = column_data("smokers_data.csv", "charges")
sorted_non_smokers = sort_data_in_column(non_smokers_gathered, smokers_gathered)
sum_of_both = sum_of_column(smokers_gathered, sorted_non_smokers)
print(round(sum_of_both / 274, 2))
if __name__ == '__main__':
main()
That’s all I have. Again, great job! I highly encourage you to keep programming, and definitely have a future in the field!
Thanks for the feedback!! I really appreciate everything you’ve said
With the README.md file I didnt know you could do that lol, and thanks for spotting the typo. With the inline comments I wanted to make it so anybody could see the code and understand it without knowing much about python but like you say it is a bit pointless . And adding the “main.py” file is an excellent idea, I honestly didn’t know how to add in the functions to a different file and that’s probably why I didn’t think of it but that is a much better way of doing it! I’ll make sure to change these.
Again, thank you for this, I’ll keep it all in mind going forward and we shall see where it leads!