Python Min() Function With Example
Hello Friends,
I would like to share with you how to use min() function in python. we will learn about the Python min() function. I am going show you python min() function example.
Python min() function returns the largest item in an iterable or the largest of two or more arguments. The min() function returns the item with the highest value.
Here I will give example for use of min() function using python. So let's see the below example:
Syntax:
min (num1, num2, num3, ...)
Example : 1
minNum = min(1,51,16,61,9,10,15)
print(minNum)
Output:
1
Example : 2
numList = [5, 16, 151, 850, 456, 115, 444, 989, 102]
print("The min Value in List : ", min(numList))
Output:
The min Value in List : 5
Example : 3
color = ['orange', 'pink', 'black', 'red']
print("The min color is : ", min(color))
Output:
The min color is : black
Example : 4
list = [[6, 8], [1, 2], [5, 4],[8,9]]
print("The minimum Value : ", min(list))
Output:
The minimum Value : [1, 2]
It will help you....
- Get Last 2 Digits of Number in Python Tutorial Example
- How to Sum of First and Last Digit of Number in Python?
- How to Get First and Last Digit of Number in Python?
- Get the Last Digit of Number in Python Tutorial Example
- Get the First Digit of Number in Python Tutorial Example
- How to Remove All Decimals from Number in Python?
- How to Convert String to Float with 2 Decimal Places in Python?
- How to Format Number to 2 Decimal Places in Python?