while loop in hindi

Python While Loop in Hindi | While Loop in python with examples in Hindi

Python

Python While Loop Hindi :- While Loop statement ek single loop hoti hai jab condition True hoti hai tab hi Statement execute hoti hai or agar Condition False hoti h tab statement execute nhi hoti hai |

Python While Loop in hindi

Python Me 2 loop hoti hai |

python while loop in hindi

Syntax While Loop :-

while test_expression:
    Body of while

Example 1 :-

i = 1
while i < 6:
  print(i)
  i += 1

Output :-

1
2
3
4
5

Upper Diye gye output ko Dekh Kar Aap Program ko Samanjh Sakte Hai.

Example 2 :-

i = 1
while i < 6:
  print(i)
  if i == 3:
    break
  i += 1

Output :-

1
2
3

Upper Diye gye output ko Dekh Sakte Hai Or Program ko samanjh Sakte hai |

Example 3 :-

# initialize variable
sum = 0
i = 1
n = 10

while i <= n:
    sum = sum + i
    i = i+1    # increment 1

# print the sum
print("The sum is", sum)

Output :-

The Sum is 55

Upper Diye gye output ko Dekh Sakte Hai Or Program ko samanjh Sakte hai |

While Loop with examples in python in Hindi

Also Read This Post :

Break Statement
Continue Statement

Dosto mujhe ummed hai ki aap Python While Loop in Hindi ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Leave a Reply

Your email address will not be published. Required fields are marked *