Python Break Statement in Hindi ๐ฅ | Break Statement Explained | Python Tutorial Episode 20
```html
Python Break Statement in Hindi | เคตिเคธ्เคคृเคค เคाเคเคก เคเคฐ Practical เคเคฆाเคนเคฐเคฃ
Python programming เคฎें break statement เคเค เคฌเคนुเคค เคนी เคฎเคนเคค्เคตเคชूเคฐ्เคฃ concept เคนै เคो loops เคो control เคเคฐเคจे เคฎें เคฎเคฆเคฆ เคเคฐเคคा เคนै। เคเคธ comprehensive guide เคฎें เคนเคฎ เคธीเคेंเคे เคि break statement เค्เคฏा เคนोเคคा เคนै, เคเคธे เคैเคธे use เคเคฐเคคे เคนैं, เคเคฐ real-world examples เคे เคธाเคฅ practical applications เคธเคฎเคेंเคे।
Break Statement เค्เคฏा เคนै?
Python เคฎें break statement เคเค control flow statement เคนै เคो เคिเคธी เคญी loop (for loop เคฏा while loop) เคो เคคुเคฐंเคค terminate เคเคฐ เคฆेเคคा เคนै। เคเคฌ break statement เคो execute เคिเคฏा เคाเคคा เคนै, เคคो loop เคे เคฌाเคी เคฌเคे iterations skip เคนो เคाเคคे เคนैं เคเคฐ program control loop เคे เคฌाเคฆ เคตाเคฒे statement เคชเคฐ เคเคฒा เคाเคคा เคนै।
Simple เคถเคฌ्เคฆों เคฎें เคเคนें เคคो: break statement loop เคो "เคคोเคก़" เคฆेเคคा เคนै เคเคฐ เคเคธเคธे เคฌाเคนเคฐ เคจिเคाเคฒ เคฆेเคคा เคนै।
Break Statement เคा Syntax
Break statement เคा syntax เคฌเคนुเคค เคนी เคธเคฐเคฒ เคนै:
break
เคฏเคน เคเค single keyword เคนै เคो เคिเคธी เคญी loop เคे เค ंเคฆเคฐ use เคนो เคธเคเคคा เคนै।
Break Statement เคे เคธाเคฅ For Loop เคा เคเคฆाเคนเคฐเคฃ
เคเคเค เคเค practical example เคฆेเคเคคे เคนैं เคเคนां break statement เคा use เคเคฐเคे loop เคो interrupt เคिเคฏा เคाเค:
# เคเคฆाเคนเคฐเคฃ 1: Simple for loop เคฎें break
fruits = ["apple", "banana", "cherry", "date", "elderberry"]
for fruit in fruits:
if fruit == "cherry":
print("Cherry เคฎिเคฒ เคเคฏा! Loop เคो break เคเคฐ เคฐเคนे เคนैं।")
break
print(fruit)
# Output:
# apple
# banana
# Cherry เคฎिเคฒ เคเคฏा! Loop เคो break เคเคฐ เคฐเคนे เคนैं।
เคเคธ example เคฎें เคเคฌ loop เคो "cherry" เคฎिเคฒ เคाเคคा เคนै, เคคो break statement execute เคนोเคคा เคนै เคเคฐ loop เคคुเคฐंเคค terminate เคนो เคाเคคा เคนै। "date" เคเคฐ "elderberry" print เคจเคนीं เคนोเคคे เคนैं।
Break Statement เคे เคธाเคฅ While Loop เคा เคเคฆाเคนเคฐเคฃ
Break statement while loops เคฎें เคญी use เคนो เคธเคเคคा เคนै:
# เคเคฆाเคนเคฐเคฃ 2: While loop เคฎें break
count = 0
while count < 10:
if count == 5:
print("Count 5 เคชเคฐ เคชเคนुंเค เคเคฏा। Loop เคो break เคเคฐ เคฐเคนे เคนैं।")
break
print(f"Count: {count}")
count += 1
# Output:
# Count: 0
# Count: 1
# Count: 2
# Count: 3
# Count: 4
# Count 5 เคชเคฐ เคชเคนुंเค เคเคฏा। Loop เคो break เคเคฐ เคฐเคนे เคนैं।
Nested Loops เคฎें Break Statement
Nested loops เคฎें break statement เคธिเคฐ्เคซ เคเคธ inner loop เคो terminate เคเคฐเคคा เคนै เคिเคธเคฎें เคตเคน เคฒिเคा เคนोเคคा เคนै, outer loop continue เคฐเคนเคคा เคนै:
# เคเคฆाเคนเคฐเคฃ 3: Nested loops เคฎें break
for i in range(3):
print(f"Outer loop - i: {i}")
for j in range(5):
if j == 2:
print(f" Inner loop break เคนो เคฐเคนा เคนै j = {j} เคช
เคोเค เคिเคช्เคชเคฃी เคจเคนीं:
เคเค เคिเคช्เคชเคฃी เคญेเคें