Page 140 - Plus V4 with Adobe class 7
P. 140

else:

                        print("b is not greater than a")

                   b.  a = int (input("Enter the value of a: "))
                      b = int (input("Enter the value of b: "))

                      if a > b :

                          print ("a is greater than b")

                      else :

                          print ("b is greater than a")
                   c.  num = 3.4

                      if num > 0:

                          print("Positive number")

                      elif num == 0:

                          print(“Zero”)
                      else:

                          print("Negative number")

                   d.  x = 31

                      if x > 10:

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

                          print("and also above 20!")

                        else:

                          print("but not above 20.")

               2.   Find the error in the following code and rewrite the code:
                   a.  num = int(input("Enter a Number: "))


                      if num > 5
                      print("Number greater than five"):

                      elif num < 5:

                      print("Number less than five")

                      else:

                      print("")






            138  Plus (Ver. 4.0)-VII
   135   136   137   138   139   140   141   142   143   144   145