to_list()

audeer.to_list(x)[source]

Convert to list.

If an iterable is passed, that is not a string it will be converted using list. Otherwise, x is converted by [x].

Parameters

x (Any) – input to be converted to a list

Returns

input as a list

Examples

>>> to_list("abc")
['abc']
>>> to_list((1, 2, 3))
[1, 2, 3]