0
In python How to find a min and max values of a given input?
example: if i give input 2 4 9 3 5 with space, out put should come 2 9 with a space between!! As a beginner I didn't figure it out!! Can anyone help me how to do this program!!
4 Réponses
+ 4
inp = input() # 2 4 9 3 5
inp = [int(i) for i in inp.split(“ “)]
print(min(inp), max(inp))
0
Thank you sir.........
0
Use inbuilt functions min and max
>>Min(2,4,5,8,7)
>>2
>>max(3,5,7,9,10)
>>10
0
Russ so how do you do it when you want to put an amout of inputs?
How do you make the program to stop running and give you the results(min)