Advertisement
maxim_shlyahtin

7.1

Nov 21st, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1. from typing import Union
  2.  
  3.  
  4. def product(*args: Union[int, float]) -> Union[int, float]:
  5.     s, n = list(args), 1
  6.     for i in range(len(s)):
  7.         n *= args[i]
  8.     return n
  9.  
  10.  
  11. print(product(1, 3, 2, 4, 6))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement