Write a program in Python to input a number num and print the sum of num, num2 and num3
Answers
Answered by
0
Answer:
from operator import mul, add
>>> from functools import reduce
>>> three_numbers = (5, 8, 2) # pick any three numbers
# the crux
>>> the_sum = reduce(add, three_numbers) # or use sum()
>>> the_product = reduce(mul, three_numbers)
>>> print(f"sum: {the_sum} product: {the_product}")
sum: 15 product: 80
Explanation:
please mark me as brainliest
Similar questions