vendredi 21 juillet 2017

decimal random number generator

Hi i am trying to do something rather simple but am n00b as f*** so, all i want to do is generate a list of like 10 random decimals between say 0.101 and 0.909 at present this seems to work for two decimal places

    for i in range(10):
        print (random.randint(75,95)/100)

with an out put as follows 0.93 0.8 0.85 0.89 0.89 0.78 0.79 0.91 0.82 0.86

I would like this to have 3 decimal places not 2 an i then need to select a one of the values and put it to a variable

help please




Aucun commentaire:

Enregistrer un commentaire