If you are talking about the length of the string, you can use len():
>>> s = 'please answer my question'
>>> len(s) # number of characters in s
If you need the size of the string in bytes, you need sys.getsizeof():
>>> import sys
Also, don't call your string str. It shadows the built-in str() function.