Ask Question
8 September, 22:16

In Python, create a calculator that will ask the user to input a single dimension of a shape and then display its properties.

E. g. Enter the radius of a circle; Display the circle's Diameter, Circumference and Area

Only done for square and circle.

+1
Answers (1)
  1. 8 September, 22:24
    0
    The code is given in the explanation section.

    Explanation:

    def areacalcpy ():

    _input_ = input ("Enter the shape that you wish to calculate the area: ")

    shapearea = 0

    pieval = 3.14

    if _input_ = = "Square":

    sideval = int (input ("Enter side value of the shape: "))

    shapearea = shapearea + (sideval * * 2)

    elif _input_ = = "Circle":

    circleradius = int (input ("Enter radius value of the circle: "))

    shapearea = shapearea + (2 * pieval * circleradius)

    else:

    print ("The given shape is invalid, give a valid shape to calculate area")

    print ("%.2f" % shapearea)

    areacalcpy ()

    The given code can calculate the area for both the shapes circle and square.

    Similarly the area can be calculated for triangle and rectangle.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “In Python, create a calculator that will ask the user to input a single dimension of a shape and then display its properties. E. g. Enter ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers