Page 94 - TP-Play_V-2.0_Book-7
P. 94

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


                                                          false, if, true, else


               1.  The ................................. statement is the simplest conditional statement.
               2.  In Python, the non-zero value is interpreted as ................................. .

               3.  Decision statements may give the results true or ................................. .

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

            C.  Write 'T' for true and 'F' for false.
               1.  The if…else statement is the simplest conditional statement.                        ....................

               2.   Python does not allow nested if statement.                                         ....................
               3.  The if…elif…else ladder not a conditional statement in Python.                      ....................

               4.   The if statement executes a command if the provided condition evaluates
                  to true.                                                                             ....................

               5.  The if...elif...else statement allows you to test multiple conditions.              ....................

            D.  Short answer type questions:

               1.  What is decision making statement?
                  .....................................................................................................................................................................................................

               2.  Write the syntax for the if…elif…else statement.

                  .....................................................................................................................................................................................................
               3.  Write the syntax of the if statement.

                  .....................................................................................................................................................................................................

            E.  Long answer type questions:

               1.  Draw the flowchart for nested if statement.

               2.  Write a python program to convert centimeters to inches. Hint: 1 inch = 2.54 cms
                                                                                       21 st   #Computational Thinking
            F.  What will be the output of the following programs?                  Century   #Technology Literacy
                                                                                      Skills
               1. a = int ( input ( "Enter a First Number: " ) )
                 b = int ( input ( "Enter a Second Number: " ) )
                 if a > b :

                     print ( "First number is greater than second number " )
                 else :
                     print ( "Second number is greater than first number " )






             94       Play (Ver. 2.0)-VII
   89   90   91   92   93   94   95   96   97   98   99