Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Replace First by DiogoHD
from collections.abc import Iterable
def replace_first(items: list) -> Iterable:
return items[1:]+[items[0]] if items != [] else []
March 5, 2025