fork(1) download
  1. def remove_all(a, b):
  2. f = b.find(a)
  3. return remove_all(a, b[:f] + b[f+len(a):]) if f > -1 else b
  4.  
  5. print(remove_all('an', 'banana'))
  6. print(remove_all('cyc', 'bicycle'))
  7. print(remove_all('iss', 'Mississippi'))
  8. print(remove_all('eggs', 'bicycle'))
  9.  
Success #stdin #stdout 0.04s 63564KB
stdin
Standard input is empty
stdout
ba
bile
Mippi
bicycle