Page 463 - Computer Science Class 11 With Functions
P. 463

(ii) for num in range(20, 6, -6):

                    print(num,  end = ‘#’)
                  else:
                      print()

                      print(“ALL DONE”)
                (iii)  p = 13

                  while (p > 9 or p % 9 == 0):
                      print(p, end = ‘%’)
                      p = p - 4
                (iv)  p = 43

                  while (p >= 32):
                      if p % 6 == 0:

                          print(p, end = ‘#’)
                          break
                      else:
                          print(p * 2, end = ‘*’)
                      p = p - 4
                (v) message=”Come and have a look”

                  print(“Me” in message or “Om” in message, message.find(‘a’), sep = ‘!!!’)
             34.   Sanjana wants to create a program for her school library. She wants to store the following data in the form of a
                dictionary:
                  Book Id as key
                  Author name and price as values

                Write a menu driven program to do the following:
                1.  Accept Data
                2.  Display Data
                3.  Search for book details (by entering book_id)
                4.  Exit

             35.   Explain the use of ‘*’ and ‘+’ operators with respect to lists in Python. Write a program to accept a list of integers
                and reverse the elements of the list. Display the reversed list.
                 Note: Do NOT use any built-in function or slicing concept in the program.






















                                                                                       Practice Paper 1 (Unsolved)  461
   458   459   460   461   462   463   464   465   466   467   468