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.
- Python Tkinter | Create different shapes using Canvas class
- Python | Drawing different shapes on PyGame window
- Pycairo - Creating different shapes
- Calculating the completeness score using sklearn in Python
- Calculating Wind Chill Factor(WCF) or Wind Chill Index(WCI) in Python
- PyQt5 QDockWidget – Getting Allowed Areas
- PyQt5 QDockWidget – Setting Allowed Areas
- Draw geometric shapes on images using OpenCV
- Calculating the sum of all columns of a 2D NumPy array
- Draw Color Filled Shapes in Turtle - Python
- How to Create custom Turtle shapes in Python?
- PyQt5 – Different padding size at different edge of Label
- PyQt5 - Setting different toolTip to different item of ComboBox
- Python | Creating tensors using different functions in Tensorflow
- Python | Plotting Different types of style charts in excel sheet using XlsxWriter module
- Python Tkinter | Create different type of lines using Canvas class
- Get Current Time in different Timezone using Python
- How to execute a 11-digit instruction using different addressing modes in Python?
- Different plotting using pandas and matplotlib
- Plotting different types of plots using Factor plot in seaborn
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.