import re def usun(s, l1, l2): wynik = re.sub(l1 + ".*?" + l2, "", s) return wynik print (usun("ala ma kota", 'm', 'k'))
Standard input is empty
ala ota
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!