Skip to content

stdlib_math_random

Neil Tallim edited this page Jul 14, 2015 · 1 revision

Introduction

The random namespace provides random-number-related functions.

Provides

Functions

randfloat(low=0.0, high=1.0)

Returns a random float between low and high, inclusive.

randint(low=0, high)

Returns a random integer between low and high, inclusive.

choose(items)

Returns a random item from items.

sample(items, sample_size)

Returns up to sample_size items from items.

Selection order is preserved.

Clone this wiki locally