Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2-liner: ceil & floor solution in Clear category for Middle Characters by Stensen
from math import ceil as c, floor as f
middle = lambda t: t[f(len(t)/2) if len(t)%2==1 else f(len(t)/2) - 1:c(len(t)/2) if len(t)%2==1 else c(len(t)/2) + 1]
Oct. 7, 2020