Py.–Random

 0    12 fiszek    sir
ściągnij mp3 drukuj graj sprawdź się
 
Pytanie Odpowiedź
A random item from a list, tuple, or string.
rozpocznij naukę
choice(seq)
A randomly selected element from range(start, stop, step).
rozpocznij naukę
randrange ([start,] stop [, step])
A random float r: 0<=r<1
rozpocznij naukę
random()
Sets the integer starting value used in generating random numbers. Call this function before calling any other random module function. Returns None.
rozpocznij naukę
seed([i'x])
Randomizes the items of a list in place. Returns None.
rozpocznij naukę
shuffle(lst)
A random float r, belonging to [x; y)
rozpocznij naukę
uniform(x, y)
Returns a list with a random selection from the given sequence
rozpocznij naukę
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.
rozpocznij naukę
sample(sequence, k)
Returns the current internal state of the random number generator
rozpocznij naukę
getstate()
Returns a number representing the random bits
rozpocznij naukę
getrandbits()
Get random integer in <start; stop>.
rozpocznij naukę
randint(start, stop)
setstate (f'state)
rozpocznij naukę
setstate(f'state)

Musisz się zalogować, by móc napisać komentarz.