from functools import reduce txt = 'dsadsa" sasas" sssas" sasas"' l = txt.split('"') print(reduce((lambda x, y: print(x + ' ' + y)), l))
Standard input is empty
dsadsa sasas
Traceback (most recent call last): File "./prog.py", line 6, in <module> File "./prog.py", line 6, in <lambda> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'