Page 373 - Information_Practice_Fliipbook_Class11
P. 373

Section B (2 Marks each)

              19.  Rewrite the code snippet given below using while loop:

               for x in range(2, 12, 2):

                   print(x)
              20.   Sugam has encountered some errors while writing a program to display the appropriate message when the number
                entered by the user is positive, negative, or zero. Help Sugam to correct the code segment.

               num = (input("Enter a number"))
               if num >0
                   print("Positive")
               else:
                   print("Negative")

               elif num == 0:
                   print("Zero")
              21.  Write the output of the code given below:

               numbers = [-2, -1, 5, 1, 2]
               length = len(numbers) - 1
               while length > 0:
                   n1 = numbers[length]
                   n2 = numbers[length - 1]

                   if n1 % n2 == 0:
                       print(n1 - n2, end = '#')
                   else:
                       print(n1 // n2)
                   length = length - 1

              22.  Consider the table Garment given below:
                a. Identify the candidate key(s).
                b. What is the cardinality and degree of the table?

                 GCODE    GNAME       SIZE        COLOUR    PRICE
                 111      Tshirt      XL          Red       1400.00
                 112      Jeans       L           Blue      1600.00
                 113      Skirt       M           Black     1100.00
                 114      Jacket      XL          Blue      4000.00
                 115      Trousers    L           Brown     1500.00
                 116      Ladies Top  L           Pink      1200.00

              23.  Differentiate between ALTER and UPDATE statements of SQL.
            24.  Differentiate between interactive and script modes of Python.

              25.  What do you mean by the term immersive experience?






                                                                                                Practice Paper 2  359
   368   369   370   371   372   373   374   375   376   377   378