Python String max() Method
The max() method returns the largest letter in the string.
Python String max() Syntax
max() method syntax:
max(str)
Python String max() Parameters
- str – String.
Python String max() Return Value
Return the largest letter in the string.
Python String max() Example#1
The following example demonstrates the use of the max() function.
#!/usr/bin/python3
# maximum alphabetical character in "api"
string = "api"
print(max(string))
# maximum alphabetical character in "demos"
string = "demos"
print(max(string))
Output: