Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 126 - 2611_SmartGPT Pro V(5.0) C-7
P. 126

    b.  In what situation does the else block execute in an if...else statement?
                            _____________________________________________________________________________________

                         c.  Explain the difference between a for loop and a while loop.

                            _____________________________________________________________________________________
                            _____________________________________________________________________________________

                            _____________________________________________________________________________________

                         d.  Write a Python program to print the numbers in reverse order from 5 to 1.

                            _____________________________________________________________________________________
                            _____________________________________________________________________________________

                         e.  Describe a nested if statement.

                            _____________________________________________________________________________________
                            _____________________________________________________________________________________

                            _____________________________________________________________________________________

                                                                                                       21 st   #Critical Thinking
                      5.  Competency-based/Application-based questions.                              Century   #Technology Literacy
                                                                                                      Skills
                         a.   Sneha is writing a program to categorise ages into different stages of life: Child, Teen, Adult and
                            Senior. Which control structure should Sneha use to classify the ages into these stages?

                         b.   Amit is using a for loop to print the first 6 even numbers. Which range should he use to print them?

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

                             Check if a number is divisible by both 3 and 5. Print “Divisible by both 3 and 5” if true; otherwise, print
                           “Not divisible by both.”

                            Ask the user to enter a number and calculate its factorial using a loop.
                             Ask the user to enter the radius of a circle in centimetres, then calculate and display its area and
                           circumference.
                             Take the lengths of the three sides of a triangle in centimetres from the user and display whether the
                           triangle is scalene, isosceles or equilateral.
                            Ask the user to enter two numbers and check if the first number is divisible by the second.

                      124   Computer Science (V5.0)-VII

| 121 122 123 124 125 126 127 128 129 130 131 |