Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 82 - 2607_Traclpad_Pro_5.1_flipbook_C8
P. 82

    Video based question                                                                 Scan the

                          Watch the video and answer the question.                                             QR Code

                             Which statement is used in the for and while loops?

                         LAB ACTIVITY                                                                  Computational Thinking

                         Visit your computer lab and perform the following actions:
                         ▶  Write a program in Python to compute the factorial of a given number.
                         ▶  Write a program using while loop in Python to print the multiplication table of 25.
                         ▶  Write a Python program to display the following pattern:
                            5 5 5 5 5
                            4 4 4 4
                            3 3 3
                            2 2
                            1

                              COding Zone       COding Zone    {}      =     COding Zone Computational Thinking
                                    {C ding z ne}
                                                                                                                 []
                                                                                                        COding Zone
                                                                              </>
                         Find errors in the code of the programs given below and correct them. Also write the output.
                         1.  i = 10
                           while i >= 10
                                 print (i) ;
                           i =+ 1
                         2.  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
                      understand the concept better.

                                                                                                   Iterations in Python  81

| 77 78 79 80 81 82 83 84 85 86 87 |