Page 123 - ComputerGenius_V2.1_Class8
P. 123

Exercise





                 A.  Tick ( ) the correct option.
                    1.   Python was created by Guido van Rossum, in the year                .

                         (i)   1981                                       (ii)   1986

                        (iii)   1991                                     (iv)   1996

                    2.   What would be the output of print (10 + 16)?

                         (i)   26                                         (ii)   32

                        (iii)   10 + 16                                  (iv)   (10 + 16)

                    3.   How would you print the text string “Hello!”?

                         (i)   output 'Hello!'                            (ii)   print ('Hello!')

                        (iii)   print (Hello!)                           (iv)   output (Hello!)

                    4.   In Python, the users cannot                .

                         (i)   change the data type of a variable

                        (ii)   assign the same value to the multiple variables in a single line

                        (iii)   assign values to multiple variables in a single line

                        (iv)   create multiple variables with the same name

                    5.   Which of the following is a keyword in Python?
                         (i)   else                                       (ii)   return

                        (iii)   import                                   (iv)   All of these

                 B.  Fill in the blanks using the words given below.


                                        Keyword   Hash symbol   Equal to   Variable   Output


                    1.  A                    is a named location which is used to store data in the memory.

                    2.  The print() function is used to display              .

                    3.  Single-line comments are created simply by starting with the                character.

                    4.                     is a reserved word in Python, it cannot be used as variable name.

                    5.                     sign is used as assignment operator.







                                                                                            Basics of Python  121
   118   119   120   121   122   123   124   125   126   127   128