Page 102 - TP_Modular_V2.1_Class7
P. 102

elif (number < 0):

                           print('Negative')

                       else:

                           print('Zero')

                     2. num1 = 8

                       num2 = 5

                       if (num1 % 2 == 0 and num2 % 2 == 0):

                           result = num1 + num2

                           print("The sum is:", result)

                       else:

                           result = num1 * num2

                           print("The product is:",result)

                     3. x = 31

                       if(x > 10):
                           print("Above ten")

                           if(x > 20):

                           print("and also above 20!")

                       else:

                           print("but not above 20.")


                  F.  Find the error in the following code and rewrite the code:
                     1. x = 10


                       if (x > 5):

                           print("x is greater than 5")

                     2. marksObtained = 95


                       if (marksObtained > 90):

                           print(Distinction)










                  100       Modular (Ver. 2.1)-VII
   97   98   99   100   101   102   103   104   105   106   107