4
Contributors
4
Replies
26
Views
3 Years
Discussion Span
Last Post by vegaseat
0

Does "shape" also include a dodecahedron?
We cannot decide for you how complex this program has to be, so what have you tried to do for yourself?

1

Oh, come on.
Don't demand us to find out what the task is, then solve it.

If you cannot answer your own question by using paper and pencil, then you cannot solve it in python either...

0

First ask the user what shape is wanted ...
shape = input("What shape do you want (triangle, square and rectangle): ")
Once the shape is given, follow it with a conditional statement like ...

if shape == "rectangle":
    a = float(input("Enter length of side a: "))
    b = float(input("Enter length of side b: "))
    # now do your area calculation and show result

You could use a function for the area calculation and pass arguments a and b to this function and return the area from the function.

Edited by vegaseat

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.