Page 50 - Code & Click - 7
P. 50
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.
Experiential Learning
Lab Activity 7
Program to accept a 4-digit year from the user and display whether it is a leap year or not.
(A year is a leap year if it is divisible by 4 or 400 but not by 100.)
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.
48