def domain_to_filename(domain):
 filename = domain.replace('/', '-')
 if (filename[(-1)] == '-'):
  filename = filename[:(-1)]
 filename += '.txt'
 return filename

def domain_to_filename ( domain ) : filename = domain . replace ( '/' , '-' ) if ( filename [ ( - 1 ) ] == '-' ) : filename = filename [ : ( - 1 ) ] filename += '.txt' return filename
all / are turned into - .