Python While Loop

While loop ka funda ekdum simple hai, jab tak condition true hai wah result ka output generate karta rahega. While loop ko entry control loop bhi bolte hain.

x= 10
while x< 100:
  print(x)
  x= x + 10

Python me Break statement ka concept

Break Statement ka logic simple hai, agar kisi loop ke break statement ka use hua to wah condition ko check karte hi loop ko break kar dega, fir chahe hi condition true ho. 

x= 10
while x< 100:
    print(x)
    if x == 60:

        break
    x= x + 10

Python me Continue statement ka concept

Kisi bhi loop ke andar agar Continue Statement ka use kiya gaya hai to wah lagaye gaye condition or uss particular iteration ko skip kar dega aur next value se associated output ko print karega. Example se samajhte hain:

x= 10
while x< 100:
    x= x + 10
    if x == 60:

        continue
    
print(x)    

Diye gaye example me “x” ki value har ek step me 10 times badh rahi hai aur while loop ke condition ke hisab se wah har baar x ki value print karega.
Jaise hi x ki value 60 ke equal hogi waise hi continue staement active hoga aur uss value ko print nhi karega lekin x ki value 60 se 70 ho jayegi, it means ki output kuch aisa hoga: