Sunday, March 3, 2019

Maximum & Minimum using user define function - Python3

def max_min(inp_list):
    return (' Max: %s \n Min: %s ' % (str(max(inp_list)), str(min(inp_list))))
    
n = int(input("Enter the value of n: "))
L=[]
for i in range(n):
    L.append(input("Enter element {}: ".format(i+1)))

print(max_min(L))

ScreenShots:

No comments:

Post a Comment