The Python Oracle

How to get the size of a string in Python?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Track title: CC D Schuberts Piano Sonata D 850 in D

--

Chapters
00:00 Question
00:27 Accepted answer (Score 304)
00:56 Answer 2 (Score 44)
02:37 Answer 3 (Score 9)
02:46 Answer 4 (Score 4)
03:00 Thank you

--

Full question
https://stackoverflow.com/questions/4967...

Accepted answer links:
[len()]: https://docs.python.org/2/library/functi...
[sys.getsizeof()]: http://docs.python.org/library/sys.html#...
[str()]: https://docs.python.org/2/library/functi...

Answer 2 links:
[user225312's answer]: https://stackoverflow.com/a/4967619/4518...
[variable-length encoding]: https://en.wikipedia.org/wiki/Variable-l...
[unicode]: https://docs.python.org/2/howto/unicode....

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #string #stringlength

#avk47