code: def colorful_print(raw):
      '''print colorful text in terminal.'''
  
      lines = raw.split('\n')
      colorful = True
      detail = False
      for line in lines:
          if line:
              if colorful:
                  colorful = False
                  print(colored(line, 'white', 'on_green') + '\n')
                  continue
              elif line.startswith('例'):
                  print(line + '\n')
                  continue
              elif line.startswith('【'):
                  print(colored(line, 'white', 'on_green') + '\n')
                  detail = True
                  continue
  
              if not detail:
                  print(colored(line + '\n', 'yellow'))
              else:
                  print(colored(line, 'cyan') + '\n'f colorful_print(raw):
      '''print colorful text in terminal.'''
  
      lines = raw.split('\n')
      colorful = True
      detail = False
      for line in lines:
          if line:
              if colorful:
                  colorful = False
                  print(colored(line, 'white', 'on_green') + '\n')
                  continue
              elif line.startswith('例'):
                  print(line + '\n')
                  continue
              elif line.startswith('【'):
                  print(colored(line, 'white', 'on_green') + '\n')
                  detail = True
                  continue
  
              if not detail:
                  print(colored(line + '\n', 'yellow'))
              else:
                  print(colored(line, 'cyan') + '\n')
docs: print colorful text in terminal.