Python string method max() returns the max alphabetical character from the string str.
Following is the syntax for max() method −
max(str)
str − This is the string from which max alphabetical character needs to be returned.
This method returns the max alphabetical character from the string str.
The following example shows the usage of max() method.
#!/usr/bin/python str = "this is really a string example....wow!!!"; print "Max character: " + max(str) str = "this is a string example....wow!!!"; print "Max character: " + max(str)
When we run above program, it produces following result −
Max character: y Max character: x