Mark As Completed Discussion

min()

The min() function finds the minimum value of a string, list, tuple, dictionary or multiple values passed as a parameter. Let's find the minimum values of the string, list, tuple and dictionary created prior.

PYTHON
1print("The minimum value of string is", min(string))
2print("The minimum value of list is", min(Flowers_List))
3print("The minimum value of tuple is", min(Number_Tuple))
4print("The minimum value of dictionary is", min(General_Dictionary))

The output will be:

PYTHON
1The minimum value of string is M
2The minimum value of list is Daisy
3The minimum value of tuple is one
4The minimum value of dictionary is key1

Now if we pass multiple values in min() function as parameter, let's see what happens

PYTHON
1min(1, 4, -5, 6, -10, 0)

The output will be:

PYTHON
1-10
PYTHON
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment