Page 102 - tp_Modula_v2.0
P. 102

Critical Thinking

                  F.  What will be the output of the following programs?
                      1.   tuple1=(3, 4, 6, 7)           2.     tup1 = ('sst', 'chemistry', 2010, 2022);
                           print(tuple1)                        tup2 = (1, 2, 3, 4, 5 );
                                                                print("tup1[0]: ", tup1[0])
                                                                print("tup2[1:5]:", tup2[1:5])
                      3.   checks = (10, 20, 30)           4.   friends = ("Prakash", "Gurcharan", "Ajay",
                           # Multiply tuple                     "Sanjay")
                           total = checks * 3                   print(max(friends))
                           print(total)                         print(min(friends))
                                                                earnings = (5000, 7020, 400, 800)

                                                                print(max(earnings))
                                                                print(min(earnings))


                                                    In the lab                                  Technology Literacy



                     1.  Write a program that uses max( ) function to get maximum value in tuples.
                     2.  Write a Python program to display all the elements of the given tuple (tup= ('o', 'r', 'a', 'n',
                         'g', 'e')) except 'a' and 'e'.






                   Teacher's Corner

                  1.   Discuss with students how tuple in Python is immutable?
                  2.   A tuple is constructed by enclosing a series of comma-separated items in square brackets. Is it True or False?
                      Discuss it with students.

































                  100     Touchpad MODULAR (Version 2.0)
   97   98   99   100   101   102   103   104   105   106   107