Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # сумма квадратов
- def total_quadr(pokaz_step: int, *args) -> int:
- total = 0
- for item in args:
- total += item ** pokaz_step
- return total
- # квадрат суммы
- def quadr_total(pokaz_step: int, *args) -> int:
- return sum(args) ** pokaz_step
- print('Сумма квадратов:', total_quadr(3, 20, 3, 4))
- print('Квадрат суммы:', quadr_total(3, 20, 3, 4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement