Page 120 - Trackpad_V5_Book 8
P. 120

▶    Write a Python program to display the following pattern:
                     5 5 5 5 5

                     4 4 4 4

                     3 3 3
                     2 2

                     1

                ▶    Write a Python program to display alternate numbers for the given range.
                ▶    Write a Python program to display the digits of a number.

                ▶      Write a Python program to display the sum of even and odd numbers separately within a given
                     range.




                     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 following programs given below and correct them. Also write the
                output.
                1.  l = 40
                  m = 100
                  if m > a :
                  print (“m is greater than l”)
                2.  i = 10
                  while i >= 10
                        print (i) ;
                  i =+ 1
                3.  For i in range (6) ;
                  Print (i)
                  Else if
                  Print (Done) ;







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




               FOR THE TEACHER

              Discussion of control statements should be done comparing the situation faced in daily lives. This would help students
              to understand the concept better.




             118  Pro (Ver. 5.0)-VIII
   115   116   117   118   119   120   121   122   123   124   125