YouTip LogoYouTip

Python3 Func Number Uniform

# Python3.x Python3 uniform() Function [![Image 3: Python3 Numbers](#) Python3 Numbers](#) * * * ## Description The **uniform()** method randomly generates the next real number, which is within the range [x, y]. * * * ## Syntax Here is the syntax for the uniform() method: import random random.uniform(x, y) **Note:** uniform() cannot be accessed directly; you need to import the random module and then call the method via the random static object. * * * ## Parameters * x -- The minimum value of the random number, inclusive. * y -- The maximum value of the random number, inclusive. * * * ## Return Value Returns a floating-point number N, where the range is x <= N <= y if **x < y**, or y <= N <= x if **y >> import random >>> round(random.uniform(5, 10), 2)6.63(javascript:;)Owl Night xyy***9@163.com 8 years ago (2018-09-24) ### Click to Share Note
← Python3 Func Number UniformPython3 Func Number Randrange β†’