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 in 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 through 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, such that if **x<y** then x <= N <= y, and if **y<x** then y <= N >> 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 AsinPython3 Func Number Uniform β†’