Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 136 - 2609_Logiccode
P. 136

    d.  Which of the following conditional statements is used to test multiple conditions?
                             (i)  if                                        (ii)  if…else

                            (iii)  if…elif…else                            (iv)  All of these

                         e.  Which of the following operator reverses the result, returns false, if the result is true or vice versa?
                             (i)  AND                                       (ii)  OR

                            (iii)  NOT                                     (iv)  None of these

                      2.  Fill in the blanks using the words from the help box.

                                                  false, operators, assignment, else, true

                         a.  The ____________ operators are used to assign the value of the right expression to the left operand.

                         b.  ____________ are special symbols which perform arithmetic and logical computation.
                         c.  Logical OR operator returns ____________, if one of the operands is True.

                         d.  Decision statements may give the results true or ____________.

                         e.  The ____________ block will be executed if and only if the provided condition evaluates to false.

                      3.  Write 'T' for true and 'F' for false.

                         a.  Assignment operators are used to perform arithmetic operations.

                         b.  The AND operator returns true, if both operands are false.

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

                         d.  The if…elif…else ladder is not a conditional statement in Python.

                         e.  Data types are divided into three categories.

                      4.  Think and answer.

                         a.  What do you mean by Strings in Python?
                            ______________________________________________________________________________________

                         b.  Write the Python program to check whether a given number is positive.

                            ______________________________________________________________________________________
                         c.  List the relational operators used in Python with the help of an example.

                            ______________________________________________________________________________________
                            ______________________________________________________________________________________

                         d.   What is the use of comments in programming? How many types of comments are there in Python?
                            ______________________________________________________________________________________

                            ______________________________________________________________________________________

                      134   Premium Edition-VII

| 131 132 133 134 135 136 137 138 139 140 141 |