Page 145 - Trackpad_V5_Book 7
P. 145

d.  When a parenthesis is missing in print statement, which type of error occurs?

                   (i)  Logical Error                           (ii)  Syntax Error
                  (iii)  Mathematical Error                    (iv)  None of these
               e.   A list is a collection of data elements separated by _______________ and enclosed within
                  _______________.
                   (i)  , and {}                                (ii)  \\ and .

                  (iii)  , and []                              (iv)  , and ()

            2.  Fill in the blanks using the words from the help box.

                                     Semantic, Constant, List, Data type, Identifier

               a.  _______________ is the fixed value that does not change during the execution of a program.

               b.  _______________ is the name given to variables, functions and arrays.
               c.  _______________ is a collection of data elements separated by comma and enclosed within square
                  brackets.
               d.  Logical errors are also known as _______________ errors.
               e.  _______________ is used to define the type of value a data can contain.

            3.  Think and answer.
               a.  What do you mean by a data type?
                ______________________________________________________________________________________

               b.  What will be the output of the following statement?
                print('10' + '15')
                ______________________________________________________________________________________

               c.  If a = 6, b = 8 then what will be the final value of variable a?
                  a+=a+b//2
                ______________________________________________________________________________________
               d.  Which operator is used to assign a value to a variable?

                ______________________________________________________________________________________
                ______________________________________________________________________________________

               e.  What are the errors? Explain the types of errors with examples.
                ______________________________________________________________________________________

                ______________________________________________________________________________________

               f.  Explain any one assignment operator with an example.
                ______________________________________________________________________________________

                ______________________________________________________________________________________

            4.  What will be the output of the following expressions in Python?
               a.  15 – (2*4)     ______________         b.  (14 + 4) /9       ______________
               c.  5 < 10 and 5 > 6   ______________     d.  23 – 2.5 >= 5 * 4   ______________



                                                                               Tokens and Data Types in Python  143
   140   141   142   143   144   145   146   147   148   149   150