Python expression for random number

I know enough of algebra to write code in GML (for what that’s worth) but now I’m trying to create a driven IPO curve using a Python expression to produce a random number from 0 to 1, and apparently “random()” and “random.random(1)” are not it.

So, what is the correct Python expression from a random number between 0 and 1?

You need to first import the random module to your script…


import random

print(random.random())

Edit: This is in the 2.54 official beta build.

Or (supplement)


from random import random

now you can use random() in place of random.random()