i am trying to take user input as dictionary and displaying it on the screen using following code
import ast
a = input("Please enter a dictionary: ")
d = ast.literal_eval(a)
print d
but this error is occuring
File "x.py", line 3, in <module>
d = ast.literal_eval(a)
File "/usr/lib64/python2.6/ast.py", line 68, in literal_eval
return _convert(node_or_string)
File "/usr/lib64/python2.6/ast.py", line 67, in _convert
raise ValueError('malformed string')
ValueError: malformed string