Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Craven - Replace First - Readable solution in Clear category for Replace First by corwin.ravenwood
from typing import Iterable
def replace_first(items: list) -> Iterable:
# Returns a list which matches list (items), but with the first entry shifted to the end of the list.
if items:
items.append(items[0])
return items[1:]
return items
April 15, 2021