Created
October 20, 2017 18:39
-
-
Save han8909227/eeb8b5a1e154317340c82abc5becff60 to your computer and use it in GitHub Desktop.
week1_GITS
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
def query_to_dic(query): | |
no_char = query.translate({ord(c): " " for c in "!@#$%^&*()[]{};:,./<>?\|`~-=_+"}) | |
no_char_list = no_char.split() | |
return dict(no_char_list[i:i + 2] for i in range(0, len(no_char_list), 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment