Page 122 - Gujrati Play V2.0 Class 8 Flipbook
P. 122
«kuøkúk{ 7: ÷qÃk{kt çkúuf Mxux{uLxLkku WÃkÞkuøk Ëþkoððk {kxu.
Program7.py
File Edit Format Run Options Window Help
#Program to show the use of the break statement in the for loop
for number in range(0, 12):
if(number == 7):
break
print('Number is:', number)
print('Out of loop')
ík{Lku Lke[u {wsçk ykWxÃkwx {¤þu:
Output
Number is: 0
Number is: 1
Number is: 2
Number is: 3
Number is: 4
Number is: 5
Number is: 6
Out of loop
[k÷w Mxux{uLx
[k÷w Mxux{uLxLkku WÃkÞkuøk ÷qÃMkLke ytËh ÚkkÞ Au. ßÞkhu ÷qÃkLke ytËh [k÷w Mxux{uLx {¤u Au, íÞkhu «kuøkúk{Lkwt rLkÞtºký ykøkk{e ÃkwLkhk]ðr¥k {kxu
÷qÃkLke þYykík{kt òÞ Au, ðíko{kLk ÃkwLkhkð]r¥k {kxu ÷qÃkLkk çkkfeLkk Mxux{uLxLkk yuõÍuõÞwþLkLku Akuze Ëu Au.
[k÷w Mxux{uLxLkku ðkõÞh[Lkk:
#loop statements
continue
#the code to be skipped
«kuøkúk{ 8: ÷qÃk{kt fLxeLÞw Mxux{uLxLkku WÃkÞkuøk Ëþkoððk {kxu.
Program8.py
File Edit Format Run Options Window Help
#Program to show the use of the continue statement
for number in range(0, 12):
if(number == 8):
continue
print('Number is:', number)
print('Out of loop')
120 Play (Ver. 2.0)-VIII

