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!!

19th Feb 2019, 7:52 PM
gummadi sreeshman
gummadi sreeshman - avatar
4 Réponses
+ 4
inp = input() # 2 4 9 3 5 inp = [int(i) for i in inp.split(“ “)] print(min(inp), max(inp))
19th Feb 2019, 8:06 PM
Russ
Russ - avatar
0
Thank you sir.........
19th Feb 2019, 9:13 PM
gummadi sreeshman
gummadi sreeshman - avatar
0
Use inbuilt functions min and max >>Min(2,4,5,8,7) >>2 >>max(3,5,7,9,10) >>10
31st Mar 2019, 11:13 AM
Jayesh sharma
Jayesh sharma - avatar
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)
4th Apr 2022, 6:28 PM
Siyabonga Mbendane
Siyabonga Mbendane - avatar