def expandtabs(s, tabsize=8):
 res = line = ''
 for c in s:
  if (c == ' DCTB '):
   c = (' ' * (tabsize - (len(line) % tabsize)))
  line = (line + c)
  if (c == '\n'):
   res = (res + line)
   line = ''
 return (res + line)

def expandtabs ( s , tabsize = 8 ) : res = line = '' for c in s : if ( c == ' DCTB ' ) : c = ( ' ' * ( tabsize - ( len ( line ) % tabsize ) ) ) line = ( line + c ) if ( c == '\n' ) : res = ( res + line ) line = '' return ( res + line )
expandtabs -> string return a copy of the string s with all tab characters replaced by the appropriate number of spaces .