[Tutor] Help with class example
Frank Pontius
yahufpontius at yahoo.com
Fri Oct 19 01:59:05 CEST 2012
Hello,
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 in function, returning #.
import random
def RandomNumberGen ():
if random.randrange(0, 2) == 0:
X return "tails"
return "heads"
Simple enough, but running in my Python 2.7.3 IDLE - it will not even run,
and give syntax (red char box) error at the X above.
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121018/19a1cb6a/attachment-0001.html>
More information about the Tutor
mailing list