Page 147 - Touchpad_Plus_V3.2_Class 8
P. 147

Mind Boggler





                                                                                                 21 st   #Technology Literacy
                 A.  Competency-based/Application-based questions.                            Century
                                                                                                Skills  #Critical Thinking
                    1.   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.
                    2.   Ravi writes a program  to count  from 1 to 5, but the program  keeps running
                       indefinitely because the condition for stopping is never met. What type of loop did Ravi use to
                       create this program?




                                                                                                21 st   #Technology Literacy
                  Lab Session                                                                 Century   #Critical Thinking
                                                                                                Skills

                  Write a program:
                      To print multiplication table of any given number using for loop.

                      To count number of vowels in a given string.
                      To determine whether a given number is an Armstrong number or not.
                      To use the for loop to print the numbers 8, 11, 14, 17, 20, ... , 83, 86, 89.

                      To use the for loop to print the numbers 100, 98, 96, ... , 4, 2.
                      To print 1 to 100 using while loop.
                       To find out the sum of numbers within the range 1 to 100 using while loop.

                      To calculate the sum of first ten even numbers by using the while loop and the for loop.






                 Teacher's Note

                   1.  Discuss about all the looping statements of Python with the students.
                   2.  Go through all the topics covered in this chapter.




















                                                                                               Loops in Python       145
   142   143   144   145   146   147   148   149   150   151   152