Home Chapters Projects About
HomeProjects › Day 44
DAY 44 — 60 DAY PYTHON CHALLENGE

Student Management

Python mein Student Management banao — Hindi mein step by step

Advertisement

Project kya hai?

Day 44 ka project hai Student Management! Yeh project banane se aap Python ke important concepts practice kar payenge. Neeche complete code hai — copy karo aur chalao!

Complete Python Code

python — student_mgmt.py
class StudentManager:
    def __init__(self):
        self.students = []
        self.next_id  = 1

    def calc_grade(self, marks):
        if marks >= 90: return "A+"
        if marks >= 80: return "A"
        if marks >= 70: return "B"
        if marks >= 60: return "C"
        if marks >= 33: return "D"
        return "F"

    def add(self, name, marks):
        grade = self.calc_grade(marks)
        self.students.append({
            "id":    self.next_id,
            "name":  name,
            "marks": marks,
            "grade": grade
        })
        print(f"Student add hua - ID:{self.next_id} {name} ({grade})")
        self.next_id += 1

    def show_all(self):
        if not self.students:
            print("Koi student nahi hai!")
            return
        sorted_s = sorted(self.students, key=lambda x: x["marks"], reverse=True)
        print(f"\n{'ID':4} {'Naam':15} {'Marks':8} {'Grade'}")
        print("-" * 35)
        for s in sorted_s:
            print(f"  {s['id']:2}   {s['name']:13}  {s['marks']:6}   {s['grade']}")

    def topper(self):
        if self.students:
            t = max(self.students, key=lambda x: x["marks"])
            print(f"Topper: {t['name']} - {t['marks']} marks ({t['grade']})")

    def search(self, name):
        found = [s for s in self.students if name.lower() in s["name"].lower()]
        if found:
            for s in found:
                print(f"  Mila: {s['name']} - {s['marks']} ({s['grade']})")
        else:
            print("Student nahi mila!")

sm = StudentManager()
while True:
    print("\n1. Student add karo")
    print("2. Sab dikhaao")
    print("3. Topper dekho")
    print("4. Search karo")
    print("5. Baahar jao")
    ch = input("Choice: ")
    if ch == "1":
        sm.add(input("Naam: "), int(input("Marks (out of 100): ")))
    elif ch == "2": sm.show_all()
    elif ch == "3": sm.topper()
    elif ch == "4": sm.search(input("Naam search karo: "))
    elif ch == "5": break
OUTPUT
Choice: 1
Naam: Priya
Marks: 92
Student add hua - ID:1 Priya (A+)

ID   Naam            Marks    Grade
-----------------------------------
  1   Priya            92     A+
  2   Rahul            78      B

Topper: Priya - 92 marks (A+)

Code kaise kaam karta hai?

Auto-increment ID se har student unique hota hai. sorted(key=lambda, reverse=True) se marks ke hisaab se sort hota hai. Grade automatically calculate hoti hai.
Advertisement

📋 Project ka Introduction

Student Management System Python ka Day 44 ka project hai. Is project mein aap Python ke important concepts practice karenge jo real-world applications mein bahut use hote hain.

Yeh project beginners ke liye design kiya gaya hai lekin kaafi concepts cover karta hai. Step by step samjho, code chalao, aur khud modify karke practice karo.

Is tarah ke projects banane se aapka Python confidence badh jaata hai aur aap asli problems solve karna seekh jaate hain. Chaliye code samjhte hain!

🧠 Is Project mein kya seekhoge?

Yeh project banate waqt aap ye Python concepts use karoge:
ConceptKya karta hai
VariablesData store karna
FunctionsReusable code blocks
LoopsRepeat karna
ConditionsDecisions lena
Input/OutputUser se interact karna

📝 Code kaise kaam karta hai — Step by Step

Neeche code ki poori logic step-by-step samjhayi gayi hai:
  1. Problem samjho: Student Management System mein kya karna hai
  2. Required variables aur data structures decide karo
  3. Logic step-by-step likhó
  4. Code mein implement karo
  5. Test karo aur bugs fix karo

⚠️ Common Mistakes — Bhool mat jaana!

Beginners yeh galtiyan aksar karte hain — dhyan rakho:
  • ⚠️ Indentation sahi rakho — Python mein spaces matter karti hain
  • ⚠️ Variables ko use se pehle define karo
  • ⚠️ Input ko int()/float() mein convert karo agar number chahiye
  • ⚠️ Edge cases handle karo — kya hoga agar user galat input de?

🏋️ Practice Exercises — Aage badho!

Yeh project complete karne ke baad in exercises se practice karo:
  • 💡 Student Management System mein naya feature add karo
  • 💡 Code ko functions mein refactor karo
  • 💡 Error handling improve karo
  • 💡 File mein data save karo

❓ Aksar Pooche Jane Wale Sawal (FAQ)

Q: Student Management System project kyon banana chahiye?

A: Har project ek naya concept sikhata hai. Practice se hi Python fluent aati hai.
Q: Code run nahi ho raha?

A: Indentation check karo, syntax errors dekho, variables define hain ya nahi check karo.
Q: Kaise improve karein?

A: Pehle basic version complete karo, phir ek ek feature add karte jao.