Python String: Find Max & Min Characters
You can use the built-in functions max() and min() in Python to get the maximum and minimum characters in a string.
text = "hello"
max_char = max(text)
min_char = min(text)
print("最大字符:", max_char)
print("最小字符:", min_char)
This code will output:
最大字符: o
最小字符: e