Py.–Random

 0    12 Fiche    sir
скачать mp3 басу ойын өзіңді тексер
 
сұрақ жауап
A random item from a list, tuple, or string.
оқуды бастаңыз
choice(seq)
A randomly selected element from range(start, stop, step).
оқуды бастаңыз
randrange ([start,] stop [, step])
A random float r: 0<=r<1
оқуды бастаңыз
random()
Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None.
оқуды бастаңыз
seed([i'x])
Randomizes the items of a list in place. Returns None.
оқуды бастаңыз
shuffle(lst)
A random float r, belonging to [x; y)
оқуды бастаңыз
uniform(x, y)
Returns a list with a random selection from the given sequence
оқуды бастаңыз
choices(sequence, weights=None, cum_weights=None, k=1)
returns a list with a randomly selection of a specified number of items from a sequnce.
оқуды бастаңыз
sample(sequence, k)
Returns the current internal state of the random number generator
оқуды бастаңыз
getstate()
Returns a number representing the random bits
оқуды бастаңыз
getrandbits()
Get random integer in <start; stop>.
оқуды бастаңыз
randint(start, stop)
setstate (f'state)
оқуды бастаңыз
setstate(f'state)

Пікір қалдыру үшін жүйеге кіру керек.