Answer the question
In order to leave comments, you need to log in
Returning a unicode number?
explain the difference
The len string function counts the number of Unicode characters, not bytes.
The len() function returns the number of bytes since ds is a variable bytes
snowman = '\u2603'
ds =snowman.encode('utf-8')
len(ds)
3
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question