🏠 Home 📚 Chapters 💻 Projects ℹ️ About
HomeProjects › Day 19
DAY 19 — 60 DAY PYTHON CHALLENGE

💻 Multiplication Table

Python में Multiplication Table — पहाड़ा

Advertisement

Project kya hai?

Day 19 ka project hai Multiplication Table! Neeche complete code hai — copy karo aur chalao!

Complete Python Code

python — table.py
def print_table(n, upto=10):
    print(f"
=== {n} ka Pahada ===")
    for i in range(1, upto+1):
        product = n * i
        bar     = "#" * (product // n)
        print(f"  {n:3} x {i:2} = {product:4}  {bar}")

print("=== Multiplication Table ===")
while True:
    print("
1. Ek number ka pahada")
    print("2. Custom range ka pahada")
    print("3. Multiple tables ek saath")
    print("4. Table grid (1-10 x 1-10)")
    print("5. Baahar jao")
    ch = input("Choice: ")
    if ch == "1":
        n = int(input("Number: "))
        print_table(n)
    elif ch == "2":
        n     = int(input("Number: "))
        start = int(input("Start: "))
        end   = int(input("End: "))
        print(f"
{n} ka pahada ({start} to {end}):")
        for i in range(start, end+1):
            print(f"  {n} x {i} = {n*i}")
    elif ch == "3":
        nums = input("Numbers (space se alag): ").split()
        for n in nums:
            print_table(int(n), 5)
    elif ch == "4":
        print("
Multiplication Grid (1-10):")
        print("    ", end="")
        for i in range(1, 11):
            print(f"{i:4}", end="")
        print()
        print("  " + "-"*42)
        for i in range(1, 11):
            print(f"{i:2} |", end="")
            for j in range(1, 11):
                print(f"{i*j:4}", end="")
            print()
    elif ch == "5":
        break
OUTPUT
Number: 5
=== 5 ka Pahada ===
  5 x  1 =    5  #
  5 x  2 =   10  ##
  5 x  3 =   15  ###
  5 x  4 =   20  ####
  5 x  5 =   25  #####
  5 x 10 =   50  ##########

Multiplication Grid (1-10):
       1   2   3 ...
  1 |  1   2   3 ...
  2 |  2   4   6 ...

Code kaise kaam karta hai?

range(1, upto+1) se loop chalta hai. Bar chart # se multiplication visually dikhta hai. Grid mein nested loops se 2D table banti hai.
Advertisement

📋 Project ka Introduction

Multiplication Table Python ka Day 19 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: Multiplication Table 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:
  • 💡 Multiplication Table 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: Multiplication Table 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.
🏠 📋 Projects Day 20 →