Can random float numbers be generated through using math module?
Asked
Active
Viewed 2,860 times
2
-
https://docs.python.org/3/library/random.html – Wör Du Schnaffzig Apr 22 '21 at 12:11
-
1This only talks about the random function. It does not talk about float numbers. Am I mistaken? – DrosnickX Apr 22 '21 at 12:56
-
first you should ask Google for this. – furas Apr 22 '21 at 19:24
1 Answers
3
From my experience dealing with python, I can only say that the random function can help in generating random float numbers. Take the example below;
import random
# Random float number between range 15.5 to 80.5
print(random.uniform(15.5, 80.5))
# between 10 and 100
print(random.uniform(10, 100))
The random.uniform()
function returns a random floating-point number between a given range in Python
The two sets of code generates random float numbers. You can try experimenting with it to give you what you want.

DrosnickX
- 425
- 5
- 10