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