how to break line in python when f string code example Example: break line in string python myString = '1X2X3X' print (myString.replace ('X', 'X\n'))