mardi 14 septembre 2021

List of differing values appended into python list

I have

import random
gamma = 1/7
rand1 = random.uniform(1.5, 2.5)
beta = rand1 * gamma
#print(beta)

empty = []
for i in range(100):
    empty.append(beta)

which gives the list empty as the same value of beta 100 times. However, what I wish to have is the list empty consisting of 100 different values of beta. How can this be achieved?




Aucun commentaire:

Enregistrer un commentaire