fork download
  1. import re
  2. text = "the quick brown fox jumps over the lazy dog"
  3. print( re.sub(r"(\S)(\s*)(\S)", lambda x: f'{x.group(1).lower()}{x.group(2)}{x.group(3).upper()}', text) )
  4. # tHe QuIcK bRoWn FoX jUmPs OvEr ThE lAzY dOg
Success #stdin #stdout 0.03s 9424KB
stdin
Standard input is empty
stdout
tHe QuIcK bRoWn FoX jUmPs OvEr ThE lAzY dOg