Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 147 - 2612_Digimind
P. 147

    21 st
                        LAB ACTIVITY                                                           Century   #Technology Literacy
                                                                                                 Skills

                         Visit your computer lab and perform the following actions:
                         ▶   Write a program in Python to find whether a given number is divisible by 5 or not.

                         ▶  Write a program using a while loop in Python to print the multiplication table of 25.
                         ▶   Write a program to enter the age of a person and find out whether he is retired or not. The age
                            of retirement is 60 years.
                         ▶   A school has the following rules for the grading system: Below 20 – F 20 to 40 – E 40 to 60 - D
                            60 to 80 – C 80 to 90 – B Above 90 - A Write a program to enter the marks and print the
                            corresponding grade in Python

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

                                                                                                #Critical Thinking
                                                                                             21 st
                              COding Zone       COding Zone    {}      =     COding Zone
                                    {C ding z ne}
                                                                                           Century
                                                                                                #Technology Literacy
                                                                                            Skills
                                                                              </>
                         Identify the errors in the following Python code and rewrite the code after correcting:
                         1.  x = 5
                           if x = 5:
                               print("x is equal to 5")
                         2.  num = 20

                           if num => 20:
                               print("num is greater than or equal to 20")
                           else
                               print("num is less than 20")

                           CAREER HERE

                     People who are experts 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.

                                                                                            Control Structures in Python  145

| 142 143 144 145 146 147 148 149 150 151 152 |