Not sure what random variable function means - the typical float between 0 and 1 as in other languages?
Rather than guess - here is a tip for seeing what functions may be available in a particular module
Getting a dir (directory) on an imported module lists the functions
Output:
['BPF', 'LOG4', 'NV_MAGICCONST', 'RECIP_BPF', 'Random', 'SG_MAGICCONST', 'SystemRandom', 'TWOPI', '_BuiltinMethodType', '_MethodType', '_Sequence', '_Set', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_acos', '_bisect', '_ceil', '_cos', '_e', '_exp', '_inst', '_itertools', '_log', '_os', '_pi', '_random', '_sha512', '_sin', '_sqrt', '_test', '_test_generator', '_urandom', '_warn', 'betavariate', 'choice', 'choices', 'expovariate', 'gammavariate', 'gauss', 'getrandbits', 'getstate', 'lognormvariate', 'normalvariate', 'paretovariate', 'randint', 'random', 'randrange', 'sample', 'seed', 'setstate', 'shuffle', 'triangular', 'uniform', 'vonmisesvariate', 'weibullvariate']
Jumping to the items that don't have an underline at the beginning, you see choice that was mentioned earlier, but also random (which is the 0-1 function), gauss, lognormvariate, and a wide range of random distributions to pull from. Very cool. So, you now want to know what randrange does.
Output:
Help on method randrange in module random:
randrange(start, stop=None, step=1, _int=<class 'int'>) method of random.Random instance
Choose a random item from range(start, stop[, step]).
This fixes the problem with randint() which includes the
endpoint; in Python this is usually not what you want.
Probably you want random,
Output:
>>> help(random.random)
Help on built-in function random:
random(...) method of random.Random instance
random() -> x in the interval [0, 1).
But it is good to know there are lots of alternatives and the built in dir and help functions will give you direction.