In this program, we will take a string as input and remove a new line from a string.
Steps to solve the program
- Take a string as input.
- Remove the new line from the string using strip().
- Print the output.
#Input string
string1= "objectorientedprogramming\n"
#Printing output
print(string1.rstrip())
Output :
objectorientedprogramming