Page 120 - Gujrati Play V2.0 Class 8 Flipbook
P. 120

WHILE Mxux{uLx

                  ðkR÷ Mxux{uLx ðkhtðkh Mxux{uLxLkku Mk{qn yuÂõÍõÞwx fhu Au, ßÞkt MkwÄe ÷kursf÷ yuõMk«uþLk Mkk[wt Lk ÚkkÞ. ßÞkhu fLzeþLk ¾kuxe çkLku Au, íÞkhu
                  ftxÙku÷ ÷qÃk{ktÚke çknkh ykðu Au. ðkR÷ Mxux{uLxLkku rMkLxuõMk Lke[u ykÃku÷ Au:
                  while (test expression):

                         Statements
                         Increment/Decrement

                   «kuøkúk{ 5: while ÷qÃkLkku WÃkÞkuøk Ëþkoððk {kxu.


                      Program5.py
                   File  Edit  Format    Run   Options   Window    Help

                   #Program to demonstrate the use of a while loop

                   # Initialize a variable
                                                                                           Output
                   count = 1
                                                                                        Count is: 1
                   #test expression
                   while count < 5:                                                     Count is: 2
                       print("Count is:", count)                                        Count is: 3
                       count += 1                                                       Count is: 4




                   Clickipedia

                    ðkR÷ ÷qÃk{kt fkuRÃký rçkLk-þqLÞ {qÕÞ nt{uþk Mkk[e rMÚkrík Ëþkoðu Au, ßÞkhu þqLÞ nt{uþk ¾kuxe rMÚkrík Ëþkoðu
                    Au.



                  yuÕMk Mxux{uLxLkku WÃkÞkuøk fheLku while ÷qÃk
                  ÃkkÞÚkkuLk ðkR÷ ÷qÃk MkkÚku yuÕMk Mxux{uLxLkku WÃkÞkuøk Mkûk{ fhu Au. ðkR÷ Mxux{uLx{kt ykÃku÷ þhík ¾kuxe çkLku íÞkhu yuÕMk ç÷kuf yuÂõÍõÞwx ÚkkÞ
                  Au.


                   «kuøkúk{ 6: ðkR÷ ÷qÃk Lkku WÃkÞkuøk yuÕMk Mxux{uLx MkkÚku Ëþkoððk {kxu.


                      Program6.py

                   File  Edit  Format   Run    Options   Window    Help

                   #Program to demonstrate the use of while loop with else statement
                   i = 1
                   while (i <= 5):
                       print(i)
                       i += 1
                   else:
                       print('The While loop ends here!')







                  118       Play (Ver. 2.0)-VIII
   115   116   117   118   119   120   121   122   123   124   125