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

Fortune Teller

Python mein Fortune Teller banao — Hindi mein step by step

Advertisement

Project kya hai?

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

Complete Python Code

python — fortune.py
import random

fortunes = {
    "career":  [
        "Naukri mein badlav aane wala hai!",
        "Promotion milne wali hai! Mehnat karte raho.",
        "Business mein naya mauka milega.",
    ],
    "love":    [
        "Pyaar mein naya chapter shuru hoga.",
        "Rishton mein meethas aayegi.",
        "Koi khaas insaan mil sakta hai!",
    ],
    "health":  [
        "Sehat ka dhyan rakho.",
        "Exercise shuru karna faydemand hoga.",
        "Pani zyada peeyo - sehat achi rahegi.",
    ],
    "money":   [
        "Paisa aayega, savdhan se kharch karo.",
        "Investment ka accha waqt hai.",
        "Kharch par control rakho.",
    ],
}

yes_no = ["Haan, bilkul!", "Abhi nahi.", "Shayad... thoda wait karo.", "Zaroor hoga!", "Savdhan raho."]

print("=== Fortune Teller ===")
naam = input("Apna naam batao: ")
print(f"\nNamaste {naam}! Dekh raha hoon...")

print("\n1. Career")
print("2. Love")
print("3. Health")
print("4. Money")
print("5. Sab categories")
print("6. Haan/Nahi sawal")
print("7. Lucky numbers")

ch = input("\nChoice: ")
cats = ["career", "love", "health", "money"]

if ch in ["1","2","3","4"]:
    cat = cats[int(ch)-1]
    print(f"\n{naam} ka {cat.upper()} Fortune:")
    for f in random.sample(fortunes[cat], 2):
        print(f"  {f}")
elif ch == "5":
    print(f"\n{naam} ka Complete Fortune:")
    for cat, msgs in fortunes.items():
        print(f"\n  {cat.upper()}:")
        print(f"    {random.choice(msgs)}")
elif ch == "6":
    q = input("\nSawal poochho: ")
    print(f"  Jawab: {random.choice(yes_no)}")
elif ch == "7":
    nums = random.sample(range(1, 100), 5)
    print(f"\n{naam} ke Lucky Numbers: {nums}")
OUTPUT
Apna naam batao: Rahul

Namaste Rahul! Dekh raha hoon...
Choice: 5

Rahul ka Complete Fortune:

  CAREER:
    Promotion milne wali hai!

  LOVE:
    Pyaar mein naya chapter shuru hoga.

  HEALTH:
    Pani zyada peeyo.

  MONEY:
    Investment ka accha waqt hai.

Code kaise kaam karta hai?

random.sample() se repeat nahi hota. Category-wise fortunes se user choice kar sakta hai. Yes/No sawal ka feature add kiya gaya hai.
Advertisement

📋 Project ka Introduction

Fortune Teller Python ka Day 56 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: Fortune Teller 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:
  • 💡 Fortune Teller 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: Fortune Teller 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.