Advertisement
kompilainenn

Untitled

Nov 29th, 2023
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # сумма квадратов
  2. def total_quadr(pokaz_step: int, *args) -> int:
  3.     total = 0
  4.     for item in args:
  5.         total += item ** pokaz_step
  6.     return total
  7.  
  8. # квадрат суммы
  9. def quadr_total(pokaz_step: int, *args) -> int:
  10.     return sum(args) ** pokaz_step
  11.  
  12. print('Сумма квадратов:', total_quadr(3, 20, 3, 4))
  13. print('Квадрат суммы:', quadr_total(3, 20, 3, 4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement