Python Min() function

Published February 16, 2022

You may occasionally want to determine the smallest value in a Python program among a set of values. To do so, you should use the min() method. The min() is a built-in function that returns the smallest input value in a  list.

Syntax
The min() method has the following syntax:

min(a,b,c,d),


where a,b,c,d are similar types of data.


Example
In this example, we will display the smallest value in the list.

x=97, 56,34,23,67,15
y= min(x)
print("Minimum value is : ",end="")
print (y)


Output
From the list, the smallest value is 15

 

Download Source code

 

Article Contributed By :
https://www.rrtutors.com/site_assets/profile/assets/img/avataaars.svg

223 Views