Page 117 - 2606_PlugGPT_C7_Flipbook
P. 117

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, Tuple, 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.  The elements in the _______________ are separated by commas and enclosed in parentheses ().
                    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 boolean 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 other than = operator.
                     ______________________________________________________________________________________

                     ______________________________________________________________________________________

                 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  115
   112   113   114   115   116   117   118   119   120   121   122