Calculating Areas Of Different Shapes Using Python
We are going to make a Python program for Calculating Areas Of some mathematical Shapes.
Input: shape name = "Rectangle" length = 10 breadth = 15 Output: Area: 150 Input: shape name = "Square" side = 10 Output: Area: 100
In this program, We will ask the user to input the shape’s name. If it exists in our program then we will proceed to find the entered shape’s area according to their respective formulas. If that shape doesn’t exist then we will print “Sorry! We cannot find this shape.” message on the screen.
Below is the implementation:
Calculate Shape Area Enter the name of shape whose area you want to find: rectangle Enter rectangle's length: 10 Enter rectangle's breadth: 15 The area of rectangle is 150.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course