Page 79 - TP_Prime_V2.2_Class7
P. 79

c.   Which of the following is not the conditional statement in Python?
                        (i)  if Statement                                  (ii)   if…else Statement

                        (iii)  if...elif...else Statement                  (iv)   None of these

                     d.  What is the answer of the expression, 2**2**2?

                        (i)   2                                            (ii)   16
 Prime (Ver. 2.2)-VII       e.   If a = 20 and b = 10, then what will be the output of the following code?                  MORE ON PYTHON
                                                                           (iv)   8
                        (iii)  4


                        if (False):
                           print(a + b)
                       else:


                            print(a – b)                                   (ii)   20
                        (i)   30
                        (iii)  10                                          (iv)   Nothing will print
 76                                                                                                                       77
                 2.  Write ‘T’ for true and ‘F’ for false.

                     a.  Binary operators require three operands to operate.                              ________
                     b.   The if…elif…else statement is not a conditional statement in Python.            ________

                     c.   Greater than (>) operator checks whether the value of the left operand
                        is greater than the value of the right operand.                                   ________

                     d.   Higher precedence operators are evaluated after the lower precedence
                        operators.                                                                        ________


                   Evaluation Time


                 1.  Fill in the blanks using the hints given below:

                                                  Unary, left, Multiple, +, *

                     a.    The if...elif...else statement allows you to test ________ conditions.

                     b.  ________ operator can be used to concatenate strings.
                     c.   ________ operator can be used to reprint the same string value again and again.

                     d.   ________ operators require a single operand.

                     e.  If operators are ______ associative, meaning they are evaluated from left to right.
                 2.  Short answer type questions.

                     a.   What is operator precedence in Python?

                     b.  What is the use of logical operators?
                     c.   Write the syntax of the if...elif...else statement.
   74   75   76   77   78   79   80   81   82   83   84