Python max() method
Description
The Python max() method returns the largest letter in a string.
Syntax
max() method syntax:
max(str)
Parameters
- str -- a string.
Return Value
Returns the largest letter in the string.
Example
The following example shows how to use the max() function:
#!/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);
The output of the above example is:
Max character: y
Max character: x
Python Strings