Gamerkin

ex3.4 kispython

May 11th, 2024
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def calculate_result1(m, z):
  2.     return sum([45 + z ** 3 + 63 * k + 1 for k in range(1, m + 1)])
  3.  
  4.  
  5. def calculate_result2(m, n, a):
  6.     return sum([j ** 4 + (38 * k ** 3 - 9 * c) ** 5 + 98 * c
  7.                 for j in range(1, n + 1)
  8.                 for c in range(1, a + 1) for k in range(1, m + 1)])
  9.  
  10.  
  11. def main(m, z, a, n):
  12.     result1 = calculate_result1(m, z)
  13.     result2 = calculate_result2(m, n, a)
  14.     result = result2 + result1
  15.     return float('{:.2e}'.format(result))
  16.  
Add Comment
Please, Sign In to add comment