1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*- before = """ a b c """ after = "".join(before.split("\n")) print after
1
abc