In Python, to create an array containing x
random numbers, one can do:
import random
x = 10
[random.rand() for i in range(x)]
A variable i
which is never being used, so this generates the warning
Unused variable: i
in PyDev - and I assume in other IDE's as well (did not check).
Is there another Pythonesque way to achieve the same result without a warning?