Generate a random float where the value is between 5 and 95 using the Python math module

Question:

Generate a random float where the value is between 5 and 95 using the Python math module.

Hints:

  • Use random.random() to generate a random float in [0,1].

Solution:

import random
print random.random()*100-5

Leave a Comment