Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re.sub() with lambda reverse function solution in Clear category for Backward Each Word by kkkkk
import re
def backward_string_by_word(text: str) -> str:
"""Return string with each word reversed."""
return re.sub(r"\w+", lambda m: m.group()[::-1], text)
Feb. 28, 2020