describe
Python3 uniform() Method will randomly generate the next real number , It's in [x,y] Within the scope of .
grammar
Here are uniform() The grammar of the method :
import random
random.uniform(x, y)
Be careful :uniform() It's not directly accessible , Import required random modular , And then through random Static objects call the method .
Parameters
x -- The minimum of a random number , Contains the value .
y -- The maximum of random numbers , Contains the value .
Return value
Returns a floating point number N, The value range is if x<y be x <= N <= y, If y<x be y <= N <= x.
example
Here's how to use uniform() Examples of methods :
The output of the above example is :