
Replace First
In a given sequence the first element should become the last one. An empty sequence or with only one element should stay the same.
Input: List.
Output: List or another Iterable (tuple, iterator, generator).
Examples:
assert replace_first([1, 2, 3, 4]) == [2, 3, 4, 1] assert replace_first([1]) == [1] assert replace_first([]) == []