F Python पाठ 6 – लूप्स (For Loop और While Loop) - IGAF

IGAF

The purpose of india google all farmate is to provide information related to news, education, technology, general information, general knowledge, mponline vacancy government rdvv admission, counselling, course, computer, virus,mobile,latest bharti news, information local, AI artificial intelligent


Wikipedia

Search results

indiagoogleallfarmate.com

Translate

Thursday, June 5, 2025

Python पाठ 6 – लूप्स (For Loop और While Loop)

Python Lesson 6 - Loops in Hindi

Python पाठ 6 – लूप्स (For Loop और While Loop)

Loop का मतलब है – किसी कार्य को बार-बार दोहराना

Python में दो मुख्य प्रकार के लूप होते हैं:

  • for loop – जब आपको पता हो कि कितनी बार कोड चलाना है।
  • while loop – जब कोड तब तक चले जब तक कोई शर्त पूरी हो रही हो।

1️⃣ For Loop

Syntax:

for variable in range(start, stop):

    # यहां कोड लिखा जाता है

उदाहरण:

for i in range(1, 6):

    print("संख्या है:", i)

2️⃣ While Loop

i = 1

while i <= 5:

    print("गिनती:", i)

    i += 1

⚠️ Break और Continue

Break:

for i in range(1, 10):

    if i == 5:

        break

    print(i)

Continue:

for i in range(1, 6):

    if i == 3:

        continue

    print(i)

🧠 अभ्यास:

  1. 1 से 10 तक के नंबर प्रिंट करें (for loop)
  2. 5 से 1 तक उल्टी गिनती करें (while loop)
  3. 4 पर break करें
  4. 2 को skip करें

No comments:

Post a Comment

thank to you

Note: Only a member of this blog may post a comment.

india google all farmate

india google all farmate
IGAF

Dibble click

Followers

Featured Post

Adobe New AI Tools 2026 Premiere + After Effects

Adobe Premiere Pro & After Effects New AI Tools 2026 – Full Hindi Tutorial 🎬 Adobe Premiere Pro & After...