Skip to content

umer-analysis/student-marks-saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

📚 Student Marks Saver

A Python command-line application that saves student marks to a CSV file with automatic grade calculation and persistent storage.


🎯 Features

  • ✅ Add students with name and marks
  • ✅ Automatic grade calculation
  • ✅ Save data permanently to CSV file
  • ✅ View all students in neat format
  • ✅ Error handling for invalid input
  • ✅ Header written only once automatically
  • ✅ Skips empty rows when reading

🛠️ Skills Used

  • Python functions
  • CSV file handling (read/write)
  • OS module (file existence check)
  • Error handling (try/except)
  • While loops and menu system
  • String formatting (f-strings)
  • next() to skip header row
  • append mode for data persistence

📁 Project Structure

student-marks-saver/
├── student_marks_saver.py    # Main program
├── students.csv              # Auto-created on first run
└── README.md                 # Project documentation

▶️ How to Run

Requirements

Python 3.x installed

Steps

# Clone the repository
git clone https://github.com/umer-analysis/student-marks-saver.git

# Go to project folder
cd student-marks-saver

# Run the program
python student_marks_saver.py

📖 How to Use

1. Add student
2. Show all
3. Quit

Choose: 1

Adding a Student

Name : Umer
Marks: 90
✅ Umer saved.

Viewing All Students

-----------------------------------
Name: Umer       Marks: 90    Grade: A
Name: Ali        Marks: 75    Grade: B
Name: Sara       Marks: 45    Grade: Fail
-----------------------------------

Quitting

Choose: 3
Goodbye! 👋

🎓 Grade System

Marks Grade
90 – 100 A
70 – 89 B
50 – 69 C
Below 50 Fail

💾 Data Storage

Data saved in students.csv:

name,marks,grade
Umer,90,A
Ali,75,B
Sara,45,Fail

CSV file grows every time
you add a new student! ✅
Data stays after program closes!

⚠️ Error Handling

Invalid marks input:
Name : Umer
Marks: abc
❌ Invalid! Please enter a number.
→ Goes back to menu safely! ✅

Invalid menu choice:
Choose: 9
❌ Invalid choice! Enter 1, 2 or 3.

File not found:
→ "No students saved yet!" ✅

🚀 Future Improvements

  • Delete student feature
  • Edit existing marks
  • Search student by name
  • Sort by marks highest to lowest
  • Export report as PDF
  • Calculate class average
  • Show top 3 students

👨‍💻 Author

Umer Farooq


📝 License

This project is open source and available for learning purposes.


⭐ If you found this helpful, please give it a star on GitHub!

About

Python app to save student marks with auto grade calculation and CSV file storage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages