Page 72 - Information_Practice_Fliipbook_Class11
P. 72

Ø   A variable in a name that uniquely identifies an object.
           Ø   Variables are not declared explicitly in Python. They get associated with a type that is determined implicitly.
              For example,  consider the statements,
               x = 23                          #s1
              x = 23.25                        #s2

              x = 'hello'                      #s3
                In statements s1, s2, and s3, the variable x denotes an integer (23), a floating point (23.25), and a
              string object ('hello'), respectively.
           Ø   The nongraphic characters are represented using escape sequences.
           Ø   An escape sequence starts with a backslash (\) followed by one or more characters.
           Ø   Comments are statements that are ignored by the interpreter during the execution of the program.

           Ø   input() is used to accept data input from the user.
           Ø   print() is used to display the output on the standard output device, that is, the monitor.
           Ø   A print() without any argument will print a blank line.





                                               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 the above

           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 symbols 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. print is a valid identifier.                                                              __________

          58   Touchpad Informatics Practices-XI
   67   68   69   70   71   72   73   74   75   76   77