Getting smallest character in a string using Python

If you have a string and you want to get the smallest character(lowest ASCII value), you can use min().

str = "abcde"
print("Min character: " + min(str))

#prints: Min character: a

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *