From b038f6729d5fcf3d9d6c21dc6fe8907287898708 Mon Sep 17 00:00:00 2001 From: Siddhant Agrawal Date: Sun, 7 Oct 2018 11:38:21 -0700 Subject: [PATCH] Update byte_size.md The original description was slightly misleading by saying that utf-8 will encode and find the length, whereas in reality the length was produced by len. --- snippets/byte_size.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/byte_size.md b/snippets/byte_size.md index faa8ba5fd..7f34b08df 100644 --- a/snippets/byte_size.md +++ b/snippets/byte_size.md @@ -2,7 +2,7 @@ Returns the length of a string in bytes. -`utf-8` encodes a given string and find its length. +`utf-8` encodes a given string, then `len` finds the length of the encoded string. ```python def byte_size(string): @@ -12,4 +12,4 @@ def byte_size(string): ```python byte_size('😀') # 4 byte_size('Hello World') # 11 -``` \ No newline at end of file +```