def ds_format(ds, input_format, output_format):
 return datetime.strptime(ds, input_format).strftime(output_format)

def ds_format ( ds , input_format , output_format ) : return datetime . strptime ( ds , input_format ) . strftime ( output_format )
takes an input string and outputs another string as specified in the output format .