Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 90 - 2612_Digimind
P. 90

    21 st   #Critical Thinking
                          LAB ACTIVITY                                                           Century   #Technology Literacy
                                                                                                  Skills

                          Visit your computer lab and perform the following actions:
                          ▶   Write a program using a while loop in Python to print the multiplication table of 25.

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

                          ▶   Write a program using a while loop to display the Fibonacci series up to the 10th term.

                          ▶   Write a Python program that uses a while loop to print the numbers from 1 to 20, but skips the
                              multiples of 4 using the continue statement.

                               COding Zone       COding Zone    {}      =      COding Zone               COding Zone
                                      {C ding z ne}
                                                                                              21 st
                                                                                                 #Critical Thinking
                                                                                                                  []
                                                                                            Century
                                                                                                 #Technology Literacy
                                                                                             Skills
                                                                               </>
                          Identify the errors in the following Python code and rewrite the code after correction:
                          1.  for i in range(1, 10)
                                print(i)
                          2.  for i in range(5):
                            if i == 3
                                print("Found 3")
                          3.  x = 0
                            while x < 5:
                            if x == 3:
                                break
                            print(x)
                            x += 1

                             CAREER HERE

                      People who are experts in Python may pursue their career as a Software Developer.

                         FOR THE TEACHER

                        1.  Demonstration of creating for and while loop to the students.
                        2.  Explain jump statements in detail to the students.

                       88   Premium Edition-VIII

| 85 86 87 88 89 90 91 92 93 94 95 |