Skip to content

Instantly share code, notes, and snippets.

@thesuhu
Created May 1, 2023 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesuhu/ea5b9de9350fbce65f9e744817752005 to your computer and use it in GitHub Desktop.
Save thesuhu/ea5b9de9350fbce65f9e744817752005 to your computer and use it in GitHub Desktop.
Get Country Flag Emoji
def get_country_flag(country_code):
OFFSET = 127397
codepoints = tuple(ord(char) + OFFSET for char in country_code.upper())
return chr(codepoints[0]) + chr(codepoints[1])
# usage get_country_flag("ID")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment