Page 101 - TP_V5.1_C8_fb
P. 101

COding Zone       COding Zone    {}      =     COding Zone Computational Thinking
                                {C ding z ne}
                                                                                                             []
                                                                                                    COding Zone
                                                                          </>
                     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.   Give demonstration of creating functions to the students.
                   2.   Explain List and String in detail to the students.

































                                                                                   Functions, String and List in Python  99
   96   97   98   99   100   101   102   103   104   105   106