Python Min() function

Find the smallest value in a set of values with Python's built-in min() method. Learn how to use min() to identify the smallest value in a list at rrtutors.com.

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

 

Related Tutorials & Resources