Page 145 - Computer Science Class 11 With Functions
P. 145

C.  Fill in the blanks.
               1.  A ____________________cannot be used for any purpose other than the one defined by the language.
               2.  An identifier should begin with an uppercase or lowercase alphabet, or an _______________.
               3.  _______________ are symbols used to separate various tokens in a statement.
               4.  A ________________  is an identifier that denotes a value.
               5.  An ______________operator associates a variable with the object on the right-hand side.
               6.  The input() function reads the text entered by a user until a ____________ is encountered.
               7.  The __________ function is used to print the value of a variable.
               8.  To convert the data type of input() to an integer, the _________ function is used.
            D.  Answer the following questions:
               1.  Is space included in the character set of Python?
               2.  Mention five different tokens used in Python?
               3.  Which of the following are valid Python identifiers? Justify your answer.
                 Asia&Europe, Item-name, while, For, False, your_choice, input(), output
               4.  Does the operation performed by a particular operator depend on the type of data on which it is being performed? Justify
                  your answer.
               5.  A variable is an example of an identifier.
                  Is the above statement correct? Justify your answer.
               6.  State the rules for forming a variable.
               7.  Write a statement in Python to assign the value 15.6 to the variable weight.
               8.  Consider the following statement:
                 choice = 'yes'
                    (i) Identify the operator and the operands.
                   (ii) Identify the name of the variable.
                  (iii) What is the data associated with 'yes'?

               9.  How can you assign the same value to multiple variables in Python? Illustrate with suitable example(s).
              10.  What will be the output produced by the Python interpreter on execution of the following Python code in Python shell?
                 >>> n1, n2 = 4, 5
                 >>> product, diff = n1*n2, n1-n2
                 >>> print(product)
                 >>> print(product, diff)
              11.  Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
                  answer.

                    >>> value = 8
                    >>> q = value/4
              12.  Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
                  answer.

                    >>> value = 'eight'
                    >>> product = value*3
                    >>> print(product)
              13.  Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
                  answer.

                    >>> value = 'four'
                    >>> value = value/2
                    >>> print(value)
              14.  What is a comment? How is it different from other statements in Python?
              15.  What is the purpose of sep and end clauses while invoking the print() function?




                                                                                    Basics of Python Programming  143
   140   141   142   143   144   145   146   147   148   149   150