After reading query.
below python code is still not clear,
>>> exec('print(5+10)')
15
>>> eval('print(5+10)')
15
In bash
world,
exec
replace the shell with the given command.
eval
execute arguments as a shell command.
Question:
Expression is a computation that evaluates to a value
To evaluate any expression in python(in my case print(5+10)
from above python code), How eval()
works different from exec()
?