- random() is a python function which is predefined in the random library.
- here both random are different thing,one random is library and another random is function.
- it will return the random float value in the range of 0 to 1.
program-
import random
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(random.random())
print(type(random.random()))
print(type(random.random()))
print(type(random.random()))
0.7597306350978931
0.37316037207384156
0.7701398359379902
0.27269808567197074
0.8019154831626036
0.729824832622016
0.4140064411653034
<'class 'float'>
<'class 'float'>
<'class 'float'>