i am getting syntax error while executing words[list(eval(s).keys())[0]] = list(eval(s).values())[0]; where words is an empty dictionary and s is my dictionary with string keys and values in a text file.
Can some one please help with the error ?
i am getting syntax error while executing words[list(eval(s).keys())[0]] = list(eval(s).values())[0]; where words is an empty dictionary and s is my dictionary with string keys and values in a text file.
Below is the error:
words[list(eval(s).keys())[0]] = list(eval(s).values())[0]
File "<string>", line 1
s= {'water':{'german':'wasser','french':'leau','spanish':'agua'},
^
SyntaxError: invalid syntax
Can some one please help with the error ?