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

Diary App

Python mein Diary App banao — Hindi mein step by step

Advertisement

Project kya hai?

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

Complete Python Code

python — diary.py
from datetime import datetime

diary = []
print("=== Personal Diary ===")

while True:
    print("\n1. Nai entry likho")
    print("2. Sab entries dekho")
    print("3. Entries search karo")
    print("4. Entry delete karo")
    print("5. Baahar jao")
    ch = input("Choice: ")
    if ch == "1":
        entry = input("Aaj ka diary:\n> ")
        mood  = input("Mood (Khush/Udaas/Normal): ")
        diary.append({
            "date":  datetime.now().strftime("%d-%m-%Y %H:%M"),
            "entry": entry,
            "mood":  mood
        })
        print("Entry save ho gayi!")
    elif ch == "2":
        if not diary:
            print("Koi entry nahi hai!")
        else:
            print(f"\n=== Diary ({len(diary)} entries) ===")
            for e in reversed(diary):
                print(f"\n  [{e['date']}] Mood: {e['mood']}")
                print(f"  {e['entry']}")
    elif ch == "3":
        q = input("Search word: ").lower()
        found = [e for e in diary if q in e["entry"].lower()]
        print(f"\n{len(found)} entries mili:")
        for e in found:
            print(f"  [{e['date']}] {e['entry'][:50]}...")
    elif ch == "4":
        for i, e in enumerate(diary, 1):
            print(f"  {i}. [{e['date']}] {e['entry'][:30]}")
        n = int(input("Kaun si delete karein: ")) - 1
        diary.pop(n)
        print("Entry delete ho gayi!")
    elif ch == "5":
        break
OUTPUT
Choice: 1
Aaj ka diary:
> Python seekha, bahut maza aaya!
Mood: Khush
Entry save ho gayi!

=== Diary (1 entries) ===
  [13-03-2026 10:30] Mood: Khush
  Python seekha, bahut maza aaya!

Code kaise kaam karta hai?

datetime.now().strftime() se current date aur time milta hai. reversed() se latest entry pehle dikhti hai. List of dicts se diary entries store hoti hain.
Advertisement

📋 Project ka Introduction

Diary App Python ka Day 36 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: Diary App 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:
  • 💡 Diary App 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: Diary App 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.