[Solved] Why does this not work? “d is not defined” October 2, 2022 by Kirat It appears that you are using Python 2, in which input attempts to evaluate what the user types as though it were a Python statement. You should instead use raw_input, which does not. solved Why does this not work? “d is not defined”