Skip to content Skip to sidebar Skip to footer

Python: Nameerror Name '[input]' Is Not Defined

I'm trying to make a simple little tool for converting inches to centimeters and am stuck at trying to take a user input ('y' or 'n') for deciding whether to do another conversion

Solution 1:

instead of input try raw_input:

replace:

restart = str(input("Do you wish to make another conversion? [y]Yes or [n]no: "))

on:

restart = raw_input("Do you wish to make another conversion? [y]Yes or [n]no: ")

Post a Comment for "Python: Nameerror Name '[input]' Is Not Defined"