Printing user input?
J. Clifford Dyer
jcd at sdf.lonestar.org
Thu Nov 15 19:20:15 CET 2007
On Thu, Nov 15, 2007 at 09:03:26AM -0800, Mohammed_M wrote regarding Printing user input?:
> I'm v.new to Python, so please don't be too harsh :)
> I get a NameError with the code below - All I want to do is store some
> input taken from the user in a variable called name, & then print name
> # START CODE ==========================================
> # Print name demo
> def PersonsDetails():
> name = input("What's your name?")
> # END CODE ==========================================
> Thanks for reading & any help on this
Also, you'll want to use raw_input() instead of input.
More information about the Python-list