hi, Maybe this is a proper way to do what you'd liked to achieve >>> text = "The best day of my life!" >>> newtext = '\n'.join( text.split() ) >>> print(newtext) The best day of my life! >>> yours Michael * ^Bart <gabriele1NOSPAM at hotmail.com> [2019年01月31日 10:22]: > Hello everybody! :) >> I got a text and I should replace every space with \n without to use > str.replace, I thought something like this: >> text = "The best day of my life!" >> space = (' ') >> if text.count(' ') in text: > space=\n >> rightText = text-space >> print(rightText) >> I should have an output like this: > The > best > day > of > my > life! >> -- > https://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl <michael.poeltl at univie.ac.at> Computational Materials Physics at University Wien, Sensengasse 8/12, A-1090 Wien, AUSTRIA http://cmp.univie.ac.at/ http://homepage.univie.ac.at/michael.poeltl/ using elinks-0.12, mutt-1.5.21, and vim-7.4, with python-3.6.1, on linux mint 17.3 (rose) :-) fon: +43-1-4277-51409 "Lehrend lernen wir!"