Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

MODULE – 4 ASSIGNMENT

Functions

Please write Python Programs for all the problems.

1. Write a Python function to find the Max of three numbers.


2. Write a Python function to sum all the numbers in a list.
3. Write a Python function to multiply all the numbers in a list.

ANSWERS

a=(2304,1569,1324,1787,1610,2838,45,398,909)

b=max(a)

print('Max value is :-', b)

############

a=[23,45.2,504,210,234,34,78]

b=sum(a)

print('Sum of a list :-', b)

import math

a=[2,3,4,5,6]

b=math.prod(a)
print('Product of a list:-', a)

You might also like