fork(7) download
  1. import re
  2.  
  3. spoonerize = lambda s:re.sub('([^aeiou]+|.+ )'*3,r'\3\2\1',s,1)
  4.  
  5. for string in 'plaster man', 'blushing crow', 'litigating more', 'strong wrangler', 'def ghi', 'yew fears':
  6. print(spoonerize(string))
Success #stdin #stdout 0.02s 9936KB
stdin
Standard input is empty
stdout
master plan
crushing blow
mitigating lore
wrong strangler
ghef di
few years