Thursday, July 2, 2026
HomeLanguagesPython String | max()

Python String | max()

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

Syntax:

max(string)

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

Return value:

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

Below is the Python implementation of the method max()

Python




# python program to demonstrate the use of 
# max() function 
  
# maximum alphabetical character in 
# "Lazyroar" 
string = "Lazyroar" 
print max(string)
  
# maximum alphabetical character in 
# "raj"
string = "raj" 
print max(string)


Output:

s
r
RELATED ARTICLES

4 COMMENTS

Most Popular

Dominic
32519 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6900 POSTS0 COMMENTS
Nicole Veronica
12014 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12110 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6966 POSTS0 COMMENTS