How to get the length of a string in python stack overflow?