Page 156 - Computer Science V2.0 Class 11
P. 156

Solved Exercises



              A.  Multiple Choice questions.
                 1.  Which of the following is part of the character set of Python?
                    a.  Alphabets            b. Digits              c. Special characters   d. All of these
                 2.  Which of the following is a predefined identifier in Python?
                    a.  Print                b. PRINT               c. print              d. PrinT
                 3.  Which of the following symbols is used to assign a value to a variable?
                    a.  #                    b. ^                   c. =                  d. !
                 4.  Which of the following symbol marks the beginning of a single-line comment?
                    a.  %                    b. \                   c. @                  d. #
                 5.  Which of the following functions is used to display the output on the screen?
                    a.  Print()              b. Output()            c. print()            d. output()
                 6.  An escape sequence starts with ___________ symbol.
                    a.  /                    b. \                   c. #                  d. =
                 7.  Which of the following is the default value of the argument end for the function  print()?
                    a.  '\n'                 b. '/n'                c. ''                 d. '\'
              B.  State whether the following statements are True or False:
                 1.  Comma (,) is an example of a delimiter in Python.                                       __________
                 2.  The escape sequences must be enclosed in quotes.                                        __________
                 3.  Keywords are not case-sensitive.                                                        __________
                 4.  An identifier can start with a digit.                                                   __________
                 5.  Operators are used to perform operations on operands.                                   __________
                 6.  Use of end while invoking the print() function is optional.                             __________
                 7.  input() is a valid identifier.                                                          __________
                 8.  input() is a valid token.                                                               __________
                 9.  input is a valid token.                                                                 __________
                10.  Print is a valid identifier.                                                            __________
                11.  print is a valid identifier.                                                            __________
              C.  Fill in the blanks.
                 1.  The smallest unit of a program is known as a ______________.
                 2.  _______________ are reserved words that have a specific meaning for the interpreter.
                 3.  Invoking the function ____________ prompts the user to enter data.
                 4.  _________ are included in a program to make it readable, but they are ignored by the interpreter.
                 5.  The  user  input  received  in  response  to  invoking  the  function  input() in  a program is  terminated by  pressing  the
                    __________ key.
                 6.  If no value of sep is specified, the default value of the separator (between the values) used by the print() function is
                    ________________.
                 7.  The input() function returns the data entered by the user as a ___________.
              D.  Answer the following questions:
                 1.  Which of the following cannot be used as identifiers in Python? Justify your answer.
                    True, 10on10, My Book, wrong_answer, first-name
               Ans.   True                 a keyword
                    10on10                 begins with a digit


               142   Touchpad Computer Science (Ver. 2.0)-XI
   151   152   153   154   155   156   157   158   159   160   161