random.random(), random not defined!?

E

Eduardo Schettino

do i need to import something to use random?
--

you need to import random :)

Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.0.76018998919085967
 
G

Gabriel Genellina

do i need to import something to use random?

Let me guess: you have a script named random.py? Perhaps the same one you're executing?
In that case when you write "import random", you're importing *your* script instead of the standard one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top