Page 115 - 2502_Pakistan-kifayat_C-8
P. 115

b.   Junaid is writing a program to print the names of all 30 students in his class five times. He types the
                              print statement repeatedly, but his friend suggests using a loop instead. How would using a loop
                              help Junaid avoid repeating the same code multiple times?


                                                                                   21 st
                          DIY In The Lab                                         Century   #Technology Literacy
                                                                                       #Critical Thinking
                                                                                   Skills
                 To
                 Subject   Coding

                   Write Python programs to do the following:

                   a.  Display the multiplication table of 6 using a loop.

                   b.  Create a Python function that takes a name as input and prints a welcome message.
                   c.  Check if a number is greater than 50 and print the appropriate message.

                   d.  Write Python code using a while loop to print numbers from 10 to 1.

                   e.  Check whether a number is positive, negative, or zero and display the result.




                 For The Teacher

                    Discuss all the topics covered in this chapter.

                    Demonstrate how visual programming logic can be written using text in Python.














































                                                                                              #Texture Programming 113
   110   111   112   113   114   115   116   117   118   119   120