Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 100 - 2629_Devagiri_C-7
P. 100

    LAB LEARNING                                              21 st
                                                                                           Century   #Critical Thinking
                                                                                            Skills  #Technology Literacy
                             1.  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.”
                             3.  Ask the user to enter the radius of a circle in centimetres, then calculate and
                                 display its area and circumference.

                             4.  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.
                             5.  Ask the user to enter two numbers and check if the first number is divisible by the second.

                                        CODE CHECK                                                   Century   #Critical Thinking
                                                                                                      21 st
                                                                                                      Skills
                         Identify the errors in the following Python code and correct them:
                         (a)  age = 18
                              if age < 21;

                              print("Age is less than 21")
                         (b)  username = "admin"
                              password = "admin123"
                              if username = "admin" and password = "admin123"
                                  print("Login successful")
                              else
                                  print("Login failed")

                           JOB JUNCTION
                              People who are experts in Python programming may pursue careers as Python Developers,
                             Software Engineers or Data Analysts.

                       PEDAGOGY PATHWAYS

                        «   Discuss all the topics covered in this chapter with the students.
                        «   Demonstrate how indentation is used to define the body of a conditional statement.

                       98
                            Premium Edition-VII

| 95 96 97 98 99 100 101 102 103 104 105 |