I\'m trying to write a python function not using any modules that will take a string that has tabs and replace the tabs with spaces appropriate for an inputted tabstop size.
Sorry, i misread the question the first time.
This is a recursive version that should work for any number of tabs in the input :
def tabstop ( s , tabnum = 4): if not '\t' in s: return s l = s.find('\t') return s[0:l]+' '*(tabnum-l)+tabstop(s[l+1:],tabnum)