To Remove Newline From String in Python use the replace() function replace() function use to remove the new line character from a string. It replace all the\
character with the help of for loop in python. You can see this in below example. Input :list1 = ["\
pizza\
", "food is \
life", "burger\
\
"] var1 = [] for x in list1: var1.append(x.replace("\
", "")) print("New list : " + str(var1))Output :New list : ['pizza', 'food is life', 'burger ']