remove new lines to 1 new line python code example Example: remove n from string python a_string = a_string.rstrip("\n")