1.

What is the interval of the value generated by the function random.random(), assuming that the random module has already been imported?(a) (0,1)(b) (0,1](c) [0,1](d) [0,1)I got this question by my school principal while I was bunking the class.Origin of the question is Random module in portion Mapping Functions and Modules of Python

Answer»

Correct choice is (d) [0,1)

To EXPLAIN: The function random.random() generates a random value in the INTERVAL [0,1), that is, INCLUDING ZERO but excluding one.



Discussion

No Comment Found

Related InterviewSolutions