[Tutor] Help with Python

Alan Gauld alan.gauld at btinternet.com
Sun May 11 11:20:26 CEST 2014


On 11/05/14 04:16, Glen Chan wrote:
> Hello, I am a student trying to figure out Python. I am getting errors
> that I don't know how to fix. What do you do after you get the error
> message and something is highlighted? Does that have to be deleted?

The error doesn't need to be deleted because it appears in the 
interpreter, not in your code. However,...

> #>>> The Dice Game

Are you trying to type the whole program into the interactive Python shell?

If so that's the wrong approach. The >>> prompt is only intended
for entering a few lines to experiment and find out how things work.

You should create a new text file and write the code into that.
You can then run the file in the interpreter.

If you are using an IDE (such as IDLE) that usually means you use
the File->New menu and an editor window will appear. There will
then be a Run menu somewhere (in IDLE its Run->Run Module) to
run the program.

If you are using IDLE take a look at Danny's tutorial here:

http://hkn.eecs.berkeley.edu/~dyoo/python/idle_intro/index.html

As to your error please copy the en tire error message and
send it to us, otherwise we have to guess what the problem
is...

HTH
-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list