Page 53 - 2501_KVS_C-8
P. 53

C.   State whether these statements are true or false.

                        1.      A loop is used to run some commands only once when a condition is
                              True.                                                                    _________

                           2.   ‘for’ loop is used in python language.                                 _________
                           3.   range() function is used in a ‘for’ loop.                              _________

                           4.     One cannot print the following output using a ‘for’ loop:
                              10 20 30 40 50.                                                          _________

                           5.     ‘for’ is a loop that is used to run statements unlimited number
                              of times.                                                                _________






                            Something to Do


                   1.      Write a program in python to accept a number from the user and print your name up that
                         many number of times.

                   2.      Write a program in python to accept a number from the user and display the cube of
                         every number up to it.

                   3.      Write a program in python to accept any two numbers (a & b) from the user and display
                         the numbers existing between them excluding (a & b).

                   4.      Write a program in python to accept a number from the user and display that number up
                         to that many number of times. E.g. if the user enters N=5, then output should be 5 5 5
                         5 5.

                   5.    Write a program in python to display the following output: 2 5 8 11 14 17 20 23































                                                                                       Python                       51
   48   49   50   51   52   53   54   55   56   57   58