print ("This is a Geometry Calculator")
print ("1. To find the Area of a Circle")
print ("2. To find the Area of a Rectangle")
print ("3. To find the Area of a Triangle")
print ("4. Exit")
print ("")
pick = 0
pick = input("Enter the selection(1-4): ")
while pick != "4":
if pick == "1":
radius = input("Enter circles radius")
area = 3.14 *(radius*2)
print('Circles area is: ' , area)
elif pick == "2":
height = input("Enter Rectangles Height: ")
length = input("Enter Rectangles Length: ")
area = height * length
print('Rectangle area is: ', area)
elif pick == "3":
height = input("Enter Triangle Height: ")
base = input("Enter Triangle Base: ")
area = (height * base) * 0.5
print ('Triangles area is: ', area)
else:
print("Calculator has stopped.")
break
if the user inputs 1 and puts the radius
line 24, in <module>
area = 3.14 *(radius*2)
TypeError: can't multiply sequence by non-int of type 'float'
if the user inputs 2 and puts the height and length it gives this error
line 30, in <module>
area = height * length
TypeError: can't multiply sequence by non-int of type 'str'
if the user inputs 3 and puts the height and base it gives this error
line 36, in <module>
area = (height * base) * 0.5
TypeError: can't multiply sequence by non-int of type 'str'
ive tried this but it doesnt work
radius = double(input("Enter circles Radius: "))

New Topic/Question
Reply


MultiQuote


|