Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 148 - CodePilot V5.0 C6
P. 148

    LEARNING LOGS

                      A.  Tick ( ) the correct option.
                         1.  Which Python function is used to take input from the user?

                                   (i)  print()                             (ii)  input()

                                   (iii)  str()                             (iv)  float()
                         2.   Identify the type of programming language that interacts directly with the computer’s hardware.

                                   (i)  High-level language                 (ii)  Low-level language

                                   (iii)  SQL                               (iv)  C++

                         3.  Mark the operator used for exponentiation in Python.

                                   (i)  /                                   (ii)  *

                                   (iii)  **                                (iv)  %
                         4.   Spot the correct syntax for initialising a variable in Python.

                                   (i)  variable = 5                        (ii)  5 = variable

                                   (iii)  var 5                             (iv)  let variable = 5

                         5.  Select the correct symbol used to add a single-line comment in Python.
                                   (i)  #                                   (ii)  /*

                                   (iii)  //                                (iv)  ;

                      B.  Fill in the blanks using the given hints:
                                                                                                                 Hints
                         1.   The                operator divides the left operand by the right and returns
                                                                                                                 print ()
                             the remainder.
                                                                                                                Data type
                         2.   An                is a name used to uniquely identify a variable, function, class   Identifier
                             or object in Python.                                                                 float
                         3.                  represents a real number,  where  a fraction  is denoted  by  a       %
                             decimal point.
                         4.   A                defines the kind of value a variable can hold and the operations allowed on it.
                         5.  The                 function is used to display output on the screen in Python.

                      C.  Write T for true and F for false.

                         1.  Python does not have a specific syntax for multiline comments.

                         2.  Arithmetic operators in Python include +, -, *, / and %.

                       146
                            CodePilot (V5.0)-VI

| 143 144 145 146 147 148 149 150 151 152 153 |