shuffle()

Re-order a given list.

Synopsis

shuffle(list-expression)

Description

This function randomly orders, or shuffles, the given list, and returns this new list.

Parameters

list-expression

An expression that evaluates to a list, which is then shuffled.

Returns

Returns a randomly ordered copy of the given list.

Examples

shuffle([1,2,3,4,5]) will return a shuffled list such as [3,1,4,5,2].

See Also

list(), sort()