#min and max in python
L1 = eval(input('enter list:'))#eval() helps inputting by user desires of list.
minimum=min(L1)#min() function helps to note smallest of the element.
print('minimum numeric',minimum)
maximum=max(L1)#max() function helps to note biggest of the element.
print('maximum numeric',maximum)
#output
enter list:[4,-8,65,24.0,24,7.25]
minimum numeric -8
maximum numeric 65
<?php
echo(max(0, 20, 50, 800, 178, -888)); // returns 800
echo(min(0, 30, 70, 90, -180, 400)); // returns -180
?>
def min_max(*n):
return {"min":min(n),"max":max(n)}
print(min_max(-10,1,2,3,45))
>>> max(7,22,733,56)
733
>>> min(3,3663,8727,82)
3
>>> max('hello', 'how', 'are', 'you')
'you'
>>> min('hello', 'how', 'are', 'you', 'Sir')
'Sir'