I am a beginner to python (or coding in general!) and I am currently learning list comprehension. What I want to ask is if there exists a method to generate an array of floats between 0 and 1 using only list comprehension. The output should give the same result as :
for a in range(100):
i = random()
list.append(i)
print(list)
Any help would be appreciated :)
Aucun commentaire:
Enregistrer un commentaire