Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    What version of Python are you using? Commented Jun 6, 2015 at 19:26
  • 11
    That's because the string "a" is an object in python that contains extra information. Commented Jun 6, 2015 at 19:27
  • 1
    @Some Developer is there a way to get bytes for the string only, without extra information of the complete object? Commented Jun 6, 2015 at 19:29
  • @squiguy My python version is 2.7.9 Commented Jun 6, 2015 at 19:30
  • 2
    Does this answer your question? How can I determine the byte length of a utf-8 encoded string in Python? Commented Nov 1, 2020 at 18:42