Skip to content

Instantly share code, notes, and snippets.

@SaraM92
Created September 24, 2021 06:33
Show Gist options
  • Save SaraM92/d450ff04defd331261d272a8932c2ca6 to your computer and use it in GitHub Desktop.
Save SaraM92/d450ff04defd331261d272a8932c2ca6 to your computer and use it in GitHub Desktop.
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