Page 64 - Computer - 7
P. 64

Lab Activity 5
                                                                                                   Experiential Learning
           Program to accept a number from the user and display whether it is divisible by 6 or not.
           1. Type the code as shown in the image in the Python Editor.











           2. Press the F5 key to execute the code. Sample output of the program is given below.















            Lab Activity 6
                                                                                                   Experiential Learning
           Program  to  accept  the  type  of  figure  and  display  its  area  and  perimeter.  The  user  enters  ‘R’ for
           rectangle or ‘S’ for square. In the case of rectangle, accept the values of length and breadth of the
           rectangle from the user, and in the case of square, accept the value of side of square from the user.

           1. Type the code as shown in the image in the Python Editor.






















           2. Press the F5 key to execute the code. Sample outputs of the program are given below.















               62
   59   60   61   62   63   64   65   66   67   68   69