Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Generator solution in Clear category for Replace First by erykcoapl
from typing import Iterable
def replace_first(items: list) -> Iterable:
if items:
yield from items[1:]
yield items[0]
March 4, 2021
Comments: