Last active
December 13, 2019 05:55
-
-
Save santhalakshminarayana/0f06823f76bec676b2bfde562dd99f4e to your computer and use it in GitHub Desktop.
Indian Name Generator - Group names and unique chars - Medium
This file contains hidden or 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
| group_names = [] | |
| for name in names: | |
| name_list = name.split(' ') | |
| group_names.extend(name_list) | |
| group_names = set(group_names) | |
| unique_chars=set() | |
| names = [] | |
| for name in group_names: | |
| names.append(name+'.') | |
| unique_chars = unique_chars.union(set(name)) | |
| print(unique_chars) | |
| char_to_int = dict([(chr(i+65),i) for i in range(26)]) | |
| int_to_char = dict([(i,chr(i+65)) for i in range(26)]) | |
| char_to_int['.'] = len(char_to_int)+1 | |
| int_to_char[len(int_to_char)+1] = '.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment