Py.–Random

 0    12 Datenblatt    sir
mp3 downloaden Drucken spielen überprüfen
 
Frage Antworten
A random item from a list, tuple, or string.
Lernen beginnen
choice(seq)
A randomly selected element from range(start, stop, step).
Lernen beginnen
randrange ([start,] stop [, step])
A random float r: 0<=r<1
Lernen beginnen
random()
Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None.
Lernen beginnen
seed([i'x])
Randomizes the items of a list in place. Returns None.
Lernen beginnen
shuffle(lst)
A random float r, belonging to [x; y)
Lernen beginnen
uniform(x, y)
Returns a list with a random selection from the given sequence
Lernen beginnen
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.
Lernen beginnen
sample(sequence, k)
Returns the current internal state of the random number generator
Lernen beginnen
getstate()
Returns a number representing the random bits
Lernen beginnen
getrandbits()
Get random integer in <start; stop>.
Lernen beginnen
randint(start, stop)
setstate (f'state)
Lernen beginnen
setstate(f'state)

Sie müssen eingeloggt sein, um einen Kommentar zu schreiben.