pathScripts/emoji-flag

14 lines
No EOL
358 B
Python
Executable file

#!/usr/bin/env python3
import sys
def flag_emoji(country_code):
offset = 127397
flag = ''.join(chr(ord(char) + offset) for char in country_code.upper())
return flag
if __name__ == "__main__":
if len(sys.argv) > 1:
country_code = sys.argv[1]
print(flag_emoji(country_code))
else:
print("No country code provided")