fork download
  1. import re
  2.  
  3. def next_char():
  4. char = 'a'
  5. while True:
  6. yield char
  7. char = chr(ord(char) + 1)
  8. if char > 'z':
  9. char = 'a'
  10.  
  11. seq = next_char()
  12.  
  13. str = 'Today the ---- is cloudy, but there is no ----.'
  14. str = re.sub(r'----', lambda x: ('--' + next(seq) + ')--'), str)
  15.  
  16. print(str)
  17.  
  18.  
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
Today the --a)-- is cloudy, but there is no --b)--.