Page 138 - Trackpad_V5_Book 8
P. 138

21 st
                  LAB ACTIVITY                                                            Century   #Technology Literacy
                                                                                            Skills

                   Visit your computer lab and perform the following actions.

                        In the list given below, use functions to edit it and only display numbers that are divisible by 4. If
                     there is a number greater than 100, then stop the loop iteration.

                     list = [8, 13, 16, 24, 35, 50, 60, 72, 75, 100, 120, 160]

                        Write a program that counts the total number of digits in the number 542892 and displays it as
                     output.

                        Reverse the list given below using for loop. list = [25, 35, 45, 55, 65, 75]

                        Type your name in Python and make the first and the last letter of your name uppercase and let
                     the other letters remain lowercase.





                     COding Zone       COding Zone    {}      =     COding Zone                COding Zone
                           {C ding z ne}
                                                                                21 st
                                                                                                        []
                                                                                   #Computational Thinking
                                                                              Century
                                                                                Skills
                                                                     </>
                Find errors in the code of the programs given below, correct them and write the output.
                1.  str = "Orange Education"
                  count = 0
                  for i in str;

                       if( i=='A' or i=='a' or i=='E' or i=='e'
                       or i=='I' or i=='i' or i=='O' or i=='o'
                       or i=='U' or i=='u'):
                             count += 1;
                  print("Total vowels are: " count)
                2. total: 0

                  list1 = (25, 15, 10, 5)
                  for ele in range[0, len(list1)):
                       total = total + list1[ele]
                  print(“Sum of all elements in given list: ”, total)






                  CAREER HERE
            People who are expert in Python may pursue their career as a Software Developer.



               FOR THE TEACHER
              1.  Demonstration of creating functions to the students.

              2.  Explain List and String in detail to the students.



            136   Pro (Ver. 5.0)-VIII
   133   134   135   136   137   138   139   140   141   142   143