How many bytes long is a string?

Thomas Gagne tgagne at ix.netcom.com
Mon Aug 7 22:22:33 EDT 2000


Hmm.  I need to know how many bytes a String is going to be.  Given

s = "Now is the time"

I would expect one of the following to work (it would seem intuitive...)

print s.length
print s.length()
print s.size
print s.size()
print length(s)
print size(s)

I would prefer to stick with objectname.methodname() but the obvious ones
aren't working.




More information about the Python-list mailing list