Learning more about string functions in Python