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()

filter_none

edit
close

play_arrow

link
brightness_4
code

# pythin 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)

chevron_right


Output:

s
r


My Personal Notes arrow_drop_up

Striver(underscore)79 at Codechef and codeforces D

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.