On 10/18/2012 7:59 PM, Frank Pontius wrote:
Help with class example
Hello,
Hi - this just showed up in my mailbox. Perhaps there was a delay
getting it posted.
The "" around tails and heads are not ascii quote characters. They are
what some word processors change ascii quotes into to meet typesetting
requirements.
Use a text editor, or type the code directly into IDLE.
I'm taking a beginners course on Python.
Have class example which is to be used in H/W, which I can't get to
work. Thus I figure the example is wrong. But I need this to get H/W
done.
Using'import random'and random.randrange infunction,returning #.
import random
def RandomNumberGen ():
if random.randrange(0, 2) == 0:
Xreturn"tails"
return"heads"
Simple enough, but running in my Python 2.7.3IDLE-it will not even
run,and give syntax(red char box)error at the X above.
Frank
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
--
Bob Gailer
919-636-4239
Chapel Hill NC
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor