eval('mylist = [1,2,3]')
exec for statements:
>>> exec 'lis = [1,2,3]' >>> lis [1, 2, 3]
eval works only on expressions, like
exec are okay if the string is coming from a known source, but don't use them if the string is coming from an unknown source(user input).