Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Slice first digit solution in Clear category for Replace First by Striga
from typing import Iterable
def replace_first(items: list) -> Iterable:
return items[1:] + items[:1]
if __name__ == '__main__':
assert list(replace_first([1, 2, 3, 4])) == [2, 3, 4, 1]
assert list(replace_first([1])) == [1]
assert list(replace_first([])) == []
Nov. 12, 2020