return byte size | Python

December 24th, 2021 08:31:21 PM

					
def byte_size(s): return len(s.encode('utf-8')) byte_size('😀') # 4 byte_size('Hello World') # 11

Featured Posts