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

Emoji Translator

Python mein Emoji Translator banao — Hindi mein step by step

Advertisement

Project kya hai?

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

Complete Python Code

python — emoji.py
emoji_dict = {
    "happy":   ":)", "sad":    ":(", "love":   "<3",
    "fire":    "[F]","cool":   "8)", "laugh":  "XD",
    "think":   ":?","ok":     ":+","wow":    ":O",
    "python":  "[PY]","code": "[CODE]","star": "[*]",
    "sun":     "[S]","moon":  "[M]","india":  "[IN]",
    "food":    "[YUM]","music":"[NOTE]","sleep":"[ZZZ]",
    "study":   "[BOOK]","money":"[$]","heart": "[HEART]",
    "angry":   ">:(","rocket":"[UP]","home":  "[HOME]",
    "work":    "[WORK]","game":"[GAME]","win":"[WIN]",
}

print("=== Emoji Translator ===")
print(f"Keywords ({len(emoji_dict)}): {', '.join(list(emoji_dict.keys())[:8])}...")

while True:
    text = input("\nText likho (q=quit): ")
    if text.lower() == "q":
        break
    words   = text.split()
    result  = []
    changed = 0
    for word in words:
        clean = word.lower().strip(".,!?")
        if clean in emoji_dict:
            result.append(emoji_dict[clean])
            changed += 1
        else:
            result.append(word)
    print(f"  {' '.join(result)}")
    print(f"  ({changed} words translate hue)")
OUTPUT
Keywords (26): happy, sad, love, fire, cool, ok, wow, think...

Text likho: I am happy and love python code
  I am :) and <3 [PY] [CODE]
  (4 words translate hue)

Text likho: sun moon star fire
  [S] [M] [*] [F]
  (4 words translate hue)

Code kaise kaam karta hai?

strip('.,!?') se punctuation hata dete hain before matching. Agar word dictionary mein mila to emoji, nahi mila to original word rakhte hain.
Advertisement

📋 Project ka Introduction

Emoji Translator Python ka Day 55 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: Emoji Translator 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:
  • 💡 Emoji Translator 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: Emoji Translator 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.