Advertisement
elena_gancedo

Exercice2.1_102

Jul 31st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. # Function that accepts the dimensions of a triangle and returns its area.
  2. print("Let's do triangle's area:")
  3. def area():
  4.     input1 = input("Side 'a' of triangle > ")
  5.     input2 = input("Side 'b' of triangle > ")
  6.     input3 = input("Side 'c' of triangle > ")
  7.     number1 = float(input1)
  8.     number2 = float(input2)
  9.     number3 = float(input3)
  10.     result = (number1 + number2 + number3)/2
  11.     output = str(result)
  12.     return output
  13. output = area()    
  14. print ("The result of the triangle's area has been: " + output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement