Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Middle Characters by Pactp
def middle(text: str) -> str:
n, even = divmod(len(text),2)
return text[n] if even else text[n - 1:n + 1]
March 23, 2023
Comments: