new to the python programming, havin some difficulties figuring this out. I'm trying to convert tuples into strings, for example ('h','e',4) into 'he4'. i've submitted a version using the .join function, and i'm required to come up with another ver. i'm given the following:
def filter(pred, seq): # keeps elements that satisfy predicate
if seq == ():
return ()
elif pred(seq[0]):
return (seq[0],) + filter(pred, seq[1:])
else:
return filter(pred, seq[1:])
def accumulate(fn, initial, seq):
if seq == ():
return initial
else:
return fn(seq[0], accumulate(fn, initial, seq[1:]))
hints on how to use the following to come up with conversion of tuples to strings?