Seedha content par jao
๐Ÿค– Python Hindi Bot
Namaste! Main Python Hindi Bot hoon ๐Ÿ
Python ya AI se related kuch bhi type karke pucho, ya neeche se quick sawaal chuno.
WhatsApp

Stay Connected with PythonHindii

Join our WhatsApp Community to get the latest Python tutorials, coding tips, interview questions, project updates, and learning resources directly on your phone.

Join WhatsApp Community
⇧
Python Hindi Logo
Python in Hindi | Programming Education

Python While Loop in Hindi | Complete Python Course 2026 | Episode 19



```html

Python While Loop in Hindi | Complete Python Course 2026 | Episode 19

Python เคฎें While Loop เคเค• fundamental concept เคนै เคœो เค†เคชเค•ो repeatedly code execute เค•เคฐเคจे เค•ी ability เคฆेเคคा เคนै। เค…เค—เคฐ เค†เคช Python programming เคธीเค– เคฐเคนे เคนैं เคคो While Loop เค•ो เคธเคฎเคเคจा เคฌेเคนเคฆ เคœเคฐूเคฐी เคนै। เค‡เคธ comprehensive guide เคฎें เคนเคฎ While Loop เค•ो basic level เคธे เคฒेเค•เคฐ advanced concepts เคคเค• explore เค•เคฐेंเค—े।

While Loop เค•्เคฏा เคนै? (What is While Loop?)

While Loop เคเค• control flow statement เคนै เคœो เคœเคฌ เคคเค• specified condition True เคฐเคนเคคी เคนै เคคเคฌ เคคเค• code block เค•ो execute เค•เคฐเคคा เคฐเคนเคคा เคนै। เคœैเคธे เคนी condition False เคนो เคœाเคคी เคนै, loop terminate เคนो เคœाเคคा เคนै।

While Loop เค•ा basic syntax:

while condition:
    # code block
    # statement 1
    # statement 2

While Loop เค•ैเคธे เค•ाเคฎ เค•เคฐเคคा เคนै?

  • เคชเคนเคฒे condition check เคนोเคคी เคนै
  • เค…เค—เคฐ condition True เคนै เคคो code block execute เคนोเคคा เคนै
  • Code block เค•े เคฌाเคฆ เคซिเคฐ เคธे condition check เคนोเคคी เคนै
  • เคœเคฌ เคคเค• condition True เคฐเคนเคคी เคนै, เคฏเคน process repeat เคนोเคคा เคนै
  • เคœเคฌ condition False เคนो เคœाเคคी เคนै, loop exit เคนो เคœाเคคा เคนै

Simple While Loop เค•ा เค‰เคฆाเคนเคฐเคฃ (Example)

Example 1: 1 เคธे 5 เคคเค• เค—िเคจเคคी

count = 1
while count <= 5:
    print(count)
    count = count + 1

Output:

1
2
3
4
5

เค‡เคธ example เคฎें:

  • count = 1 เคธे เคถुเคฐू เค•เคฐเคคे เคนैं
  • เคœเคฌ เคคเค• count <= 5, loop เคšเคฒเคคा เคฐเคนेเค—ा
  • เคนเคฐ iteration เคฎें count เค•ो 1 เคธे increment เค•िเคฏा เคœाเคคा เคนै
  • เคœเคฌ count = 6 เคนो เคœाเคคा เคนै, condition False เคนो เคœाเคคी เคนै เค”เคฐ loop exit เคนो เคœाเคคा เคนै

While Loop เค•े เคธाเคฅ String Operations

Example 2: String เค•े characters เค•ो print เค•เคฐเคจा

word = "PYTHON"
index = 0
while index < len(word):
    print(word[index])
    index = index + 1

Output:

P
Y
T
H
O
N

User Input เค•े เคธाเคฅ While Loop

Example 3: เคœเคฌ เคคเค• เคธเคนी answer เคจ เคฆे, เคคเคฌ เคคเค• เคชूเค›เคคे เคฐเคนें

correct_password = "Python123"
password = ""

while password != correct_password:
    password = input("เคชाเคธเคตเคฐ्เคก เคฆเคฐ्เคœ เค•เคฐें: ")
    if password == correct_password:
        print("เคชाเคธเคตเคฐ्เคก เคธเคนी เคนै!")
    else:
        print("เคชाเคธเคตเคฐ्เคก เค—เคฒเคค เคนै, เคซिเคฐ เคธे เค•ोเคถिเคถ เค•เคฐें।")
๐Ÿง‘‍๐Ÿ’ป Python Coding Lab

Python code likho, run karo aur practice karo — directly browser mein.