Skip to content

Conversation

@evankchan
Copy link
Owner

UofT-DSI | Python - Assignment 2

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

I added code to read data from csv files, complete the patient_summary function with basic mathematical operations, and complete the detect_problems function by combining multiple functions together!

What did you learn from the changes you have made?

I have learned about defining functions, reading/writing to files, use of if/elif/else statements, and the for loop!

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

I struggled in the very last question with detect_problems function. I was thinking about if i could parse out all of these functions, instead of nested functions within one another -- even though this is extremely efficient.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

The main challenge I had was in reading the CSV files, making sure I had the correct files paths so that VS code could read it. I made sure to specify the directories precisely!

How were these changes tested?

I ran each cell block seperately ensuring they match the assignment recommended outputs

A reference to a related issue in your repository (if applicable)

N/A

Checklist

  • I can confirm that my changes are working as intended

Copy link

@tianyi21 tianyi21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Evan,

✅ You implemented the function to read and display a file 💬.
✅ You completed the patient_summary() function to summarize a file.
✅ You implemented the detect_problems() function to check the file.

💬 You read the file content into the variable f with f.readlines(). Since f was defined as the file handler, you reused the same name for a different purpose. While Python didn’t complain or show an error, we usually use different variable names to improve clarity and avoid potential confusion.

🎉 Your A2 is complete!

Thanks,
Tianyi [LS]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants