Page 542 - Computer Science V2.0 Class 11
P. 542

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 that takes in a list of integers,
                  reverses its elements, and outputs the result.

                   Note: Do NOT use any built-in function or slicing concept in the program.





















               528   Touchpad Computer Science (Ver. 2.0)-XI
   537   538   539   540   541   542   543   544   545   546   547