Py.–Random

 0    12 fiche    sir
Télécharger mP3 Imprimer jouer consultez
 
question réponse
A random item from a list, tuple, or string.
commencer à apprendre
choice(seq)
A randomly selected element from range(start, stop, step).
commencer à apprendre
randrange ([start,] stop [, step])
A random float r: 0<=r<1
commencer à apprendre
random()
Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None.
commencer à apprendre
seed([i'x])
Randomizes the items of a list in place. Returns None.
commencer à apprendre
shuffle(lst)
A random float r, belonging to [x; y)
commencer à apprendre
uniform(x, y)
Returns a list with a random selection from the given sequence
commencer à apprendre
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.
commencer à apprendre
sample(sequence, k)
Returns the current internal state of the random number generator
commencer à apprendre
getstate()
Returns a number representing the random bits
commencer à apprendre
getrandbits()
Get random integer in <start; stop>.
commencer à apprendre
randint(start, stop)
setstate (f'state)
commencer à apprendre
setstate(f'state)

Vous devez vous connecter pour poster un commentaire.