input reads and evaluates a Python expression. When he tries to evaluate it, he searches for the variable e , which is not defined and is not executed.
You almost always want to use raw_input . (And in Python3, input has this behavior .)
Or, better, on Unix, use readline so the user can edit their input.
source share