Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. def perimetr(h, a, b):
  3.     x = ((abs(a - b) / 2)**2 + h**2)**0.5
  4.     per = a + b + x + x
  5.     return(per)        
  6.  
  7. h = int(input('Введите высоту: '))
  8. a = int(input('Введите первое основание: '))
  9. b = int(input('Введите второе основание: '))
  10. per_1 = perimetr(h, a, b)
  11.  
  12. h = int(input('Введите высоту: '))
  13. a = int(input('Введите первое основание: '))
  14. b = int(input('Введите второе основание: '))
  15. per_2 = perimetr(h, a, b)
  16.  
  17. print('Сумма периметров двух трапеций равна: ', per_1 + per_2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement