Open In App

Python String | min()

Last Updated : 07 Jan, 2018
Improve
Improve
Like Article
Like
Save
Share
Report

min() is an inbuilt function in Python programming language that returns the minimum alphabetical character in a string.

Syntax:

min(string)

Parameter:
min() method takes a string as a parameter

Return value:

Returns a character which is alphabetically the lowest character in the string.

Below is the Python implementation of the method min()




# python program to demonstrate the use of 
# min() function 
  
# minimum alphabetical character in 
# "geeks" 
string = "geeks" 
print(min(string))
  
# minimum alphabetical character in 
# "raj"
string = "raj" 
print(min(string))


Output:

e
a

Similar Reads

Python String Methods | Set 3 (strip, lstrip, rstrip, min, max, maketrans, translate, replace & expandtabs())
Some of the string methods are covered in the below sets.String Methods Part- 1 String Methods Part- 2More methods are discussed in this article1. strip():- This method is used to delete all the leading and trailing characters mentioned in its argument.2. lstrip():- This method is used to delete all the leading characters mentioned in its argument.
4 min read
Python | Min/Max value in float string list
Sometimes, while working with a Python list, we can have a problem in which we need to find min/max value in the list. But sometimes, we don't have a natural number but a floating-point number in string format. This problem can occur while working with data, both in web development and Data Science domain. Let's discuss a way in which this problem
6 min read
List Methods in Python | Set 1 (in, not in, len(), min(), max()...)
List methods are discussed in this article. 1. len() :- This function returns the length of list. List = [1, 2, 3, 1, 2, 1, 2, 3, 2, 1] print(len(List)) Output: 10 2. min() :- This function returns the minimum element of list. List = [2.3, 4.445, 3, 5.33, 1.054, 2.5] print(min(List)) Output: 1.054 3. max() :- This function returns the maximum eleme
2 min read
Python | Find Min/Max in heterogeneous list
The lists in Python can handle different type of datatypes in it. The manipulation of such lists is complicated. Let's say we have a problem in which we need to find the min/max integer value in which the list can contain string as a data type i.e heterogeneous. Let's discuss certain ways in which this can be performed. Method #1 : Using list compr
7 min read
Python | Pandas Series.min()
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index. Pandas Series.min() function return the mode of the underlying data in the given Series objec
2 min read
Python | Pandas dataframe.min()
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.min() function returns the minimum of the values in the given object. If the input is a series, the method will return
2 min read
Python | Pandas Index.min()
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.min() function returns the minimum value of the Index. The function works with both numerical as well as the string type ob
2 min read
Python | Pandas TimedeltaIndex.min
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas TimedeltaIndex.min() function return the minimum value of the TimedeltaIndex object or minimum along an axis. Syntax : TimedeltaI
2 min read
Use of min() and max() in Python
Prerequisite: min() max() in Python Let's see some interesting facts about min() and max() function. These functions are used to compute the maximum and minimum of the values as passed in its argument. or it gives the lexicographically largest value and lexicographically smallest value respectively, when we passed string or list of strings as argum
2 min read
Python | Numpy matrix.min()
With the help of Numpy matrix.min() method, we can get the minimum value from given matrix. Syntax : matrix.min() Return : Return minimum value from given matrix Example #1 : In this example we can see that we are able to get the minimum value from a given matrix with the help of method matrix.min(). # import the important module in python import n
1 min read
Article Tags :
Practice Tags :