The Wayback Machine - https://web.archive.org/web/20230512160716/https://www.geeksforgeeks.org/python-string-max/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Python String | max()

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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 
# "geeks" 
string = "geeks" 
print max(string)
  
# maximum alphabetical character in 
# "raj"
string = "raj" 
print max(string)


Output:

s
r
My Personal Notes arrow_drop_up
Last Updated : 08 Dec, 2021
Like Article
Save Article
Similar Reads
Related Tutorials