Simple Random code.
 
 
import randomprint random.choice(['Apple', 'Pear', 'Shrimp', 'Death', 'Life'])
 
 
Works in IDLE gui, no problem. Gives me a random pick no problem.
 
When i changed to DrPython, to continue building parts of my code.. it won't 
take that code.
 
Gives me this error.
 
C:/Python/pythonw.exe -u  "C:/Python25/random.py"Traceback (most recent call 
last):  File "C:/Python25/random.py", line 1, in <module>    import random  
File "C:\Python25\random.py", line 2, in <module>    print 
random.choice(['Apple', 'Pear', 'Shrimp', 'Death', 'Life'])AttributeError: 
'module' object has no attribute 'choice'
 
... not sure why one editor would work, and while the other won't?.. any 
suggestions.
 
Looking for some insight.
_________________________________________________________________
See what you’re getting into…before you go there.
http://newlivehotmail.com
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to