repl.it
@rovertb/

badcode

Python

Find area of a triangle with user input

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def area_of_triangle(base, height):
  area = 0.5 * base * height
  return area

input1 = input("enter base: ")
base = float(input1)

input2 = input("enter height: ")
height = float(input2)

area = area_of_triangle(base,height)

print("Area of Triangle", area)