[Tutor] Shuts down when asking user for info

Alan Gauld alan.gauld at btinternet.com
Wed Jan 26 12:13:59 CET 2011


"Casey Key" <i.eat.brainzzz at gmail.com> wrote

> Please help , run the script and see that once you press enter after
> entering name it just shuts it down, help.

> --------------
print("\tWelcome to Casey's magical python code!")
print("\tWritten by no other than Casey Key!")
print("\nWe will begin by getting some information,mmmkay?")
name = input("what is your name")
Print("your name is",name)
>-----------------

Python is case sensitive, print starts with a lowercase P.

However that should have generated an error.
How did you run the program? If you ran it from an IDE or
from the command prompt you would have seen the error.
I suspect you are just double clicking in a file manager?
Doing that the window will close before you can read it.
Always test your code by running from a prompt so that
you see all output, including errors.


Alan Gauld
Author of the Learn To Program website
http://www.alan-g.me.uk/








More information about the Tutor mailing list