CS50 python Script.
Hello, my name is Shyam Kumar, and I’m from India.
This is my final project for CS50’s Introduction to Programming with Python.
I’ve created a simple Blood Bank Management System that allows users to manage
donor information and keep records of blood donors.
The program reads from and writes to a CSV file to store the data persistently.
⚙️ Demo / Body
Let me show you how the program works.
1. Menu System
When the program starts, it displays a formatted menu with several options. The
user can choose any option to perform specific actions like adding donors,
searching, or listing all entries.
2. Adding a Donor
First, I’ll add a new donor. The program asks for the donor’s name, location, and
blood type.
This information is then written into a CSV file, which acts as the database for
the application.
3. Searching for Blood
Next, I’ll choose the search option.
Under this, there are two sub-options:
Search by name
Search by blood type
I’ll demonstrate both to show how the program retrieves matching records from the
CSV file.
4. Listing All Donors
The third option allows us to list all donor entries stored in the CSV file.
The results are displayed in a simple table-like format on the terminal.
Error Handling
I’ve also implemented basic error handling to make the program more robust.
For example, it catches errors like ValueError, FileNotFoundError, IndexError, and
other unexpected issues—so the program doesn’t crash during execution.
📘 Challenges & Conclusion
One of the challenges I faced was writing tests for my program, especially since it
relies on reading and writing to files.
However, this project helped me understand how to work with file handling,
functions, CSV files, and basic data validation in Python.
Thank you for watching my video. I hope you found this project useful and
interesting!