Page 109 - Plus V4 with Adobe class 8
P. 109

3.   What is the use of Jump statement?




                   4.  Draw the flowchart of the for loop.



                   5.   Define the use of while statement with the help of example and flowchart.



                   6.   Distinguish between continue and break statements.





                   Scratch Your Brain.                                                Century   #Critical Thinking
                                                                                        21 st
                                                                                       Skills
                   1.  Write the output of the following programs:

                       a. x=1                                            d. i = 0
                                                                            while i < 5:
                          sum=0
                                                                                print(i)
                          while(x<=10):
                                                                                i += 1
                              sum=sum+x
                                                                                if i == 3:
                              x=x+1
                                                                                    break
                          print (sum)
                                                                            else:
                       b.  fruits = [“apple”,
                                                                                print(0)
                          ”banana”,”cherry”]

                          for x in fruits:                               e. i = 0
                              print(x)                                      while i < 3:
                                                                                print (i)
                       c. i = 2
                                                                                i += 1
                          while True:
                                                                            else:
                              if i%3 == 0:
                                                                                print (0)
                                  break
                              print(i)

                              i += 2


                   2.  Competency-based/Application-based questions:

                       a.   Aahana wants to repeat a block of statements for a given number of times, until the control
                         condition is false. Which type of construct can she use for this? Write its syntax.

                       b.   Your brother Atharv wants to write a statement which will cause the program to skip the rest of
                         the statement of the current block and to move to the next iteration of the loop. But he is unable
                         to do it. Suggest the statement he should use for this.







                                                                                              #Loops in Python 107
   104   105   106   107   108   109   110   111   112   113   114