📖 Coding lessons · 3 of 4 · 5 min

लूप: बिना दोबारा लिखे दोहराएँ

लूप निर्देशों को दोहराता है। 5 का पहाड़ा छापें:

for i in range(1, 11):
    print(5, "x", i, "=", 5 * i)

range(1, 11) देता है 1, 2, … 10 (11 से पहले रुकता है)। अंदर वाली लाइन हर संख्या के लिए एक बार चलती है।

while लूप तब तक दोहराता है जब तक कोई बात सच है:

count = 3
while count > 0:
    print(count)
    count = count - 1
print("Go!")

💡 अगर शर्त कभी झूठी न हो, तो लूप कभी ख़त्म नहीं होता: अनंत लूप!

🎯 करके देखें

"for i in range(4)" कितनी बार दोहराता है?

Contact Shuddhi

Like what you see? Take the next step.

Start small and do more whenever you are ready — everything is free to join.

  1. GiveFor you

    Donate once or every month. 80G receipt by email from ₹100.

  2. Volunteer

    Weekends on the ground or online from home. Certificate after one month.

  3. Raise funds

    Start a free campaign for a cause, a person or an NGO and share it with friends.

  4. Lead & partner

    Take on more: coordinate a team, bring your NGO on board or partner as a company.