Created
September 24, 2021 06:33
-
-
Save SaraM92/d450ff04defd331261d272a8932c2ca6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str1 = "hello" | |
str2 = "😀" | |
def str_size(s): | |
return len(s.encode('utf-8')) | |
str_size(str1) | |
str_size(str2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment