0

I can not use function random.random from the Random module in Python. When I`m trying to use any function from yhe module, I get the following:

import random
x = random.random
x
<built-in method random of Random object at 0x02452D40>
1
  • Can you add a python tag please? Thx. Commented Jun 8, 2013 at 23:36

2 Answers 2

2

The line

x = random.random

merely assigns the variable x to be the function object random.random. I suspect you may actually want to call the function, which would be

x = random.random()
Sign up to request clarification or add additional context in comments.

Comments

0

you should using random.random() for show to random number in terminal. in addition if you want to set the range of number you can use randint(firts, last)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.