Page 136 - Plus V4 with Adobe class 8
P. 136

6.   What is the purpose of using max(list) and min(list) functions?







                                                                                               21 st
               Scratch Your Brain                                                           Century   #Critical Thinking
                                                                                              Skills
                1.  What will be the output of the following programs?

                   a.  list1=[13, 25, 41, 63, 82]

                     list1[1]=50

                     list1[3]=45

                     print(list1[:])
                   b.  list1=[13, 25, 41, 63, 82]

                     list1.append(19)

                     print(list1)


                   c.  list1=[13, 25, 41, 63, 82]

                     list1.insert(1, 302)
                     print(list1)


                   d.  list1=[13, 25, 41, 63, 82]
                     list2=[14, 26, 42, 64]

                     print(len(list1))

                     print(max(list2))

                     print(min(list1))
                   e.  list1=[13, 25, 41, 63, 82]

                     print(list1[4])
                2.   Find errors in the code given below.

                   a.  new_list = ['a';'b';'c';'d';'e']


                     print(new_list[-1]):

                     print(new_list:[-5])
                   b. my_list = ['o','r','a','n','g','e'];


                     print(my_list[2;5])

                     print(my_list[5:]):
                     print(my_list[::])




            134  Plus (Ver. 4.0)-VIII
   131   132   133   134   135   136   137   138   139   140   141