The code below takes a string and checks to see if it's a palindrome. Write a function that takes in the input string and removes the spaces, returning a string without spaces. Try it first on your own first but if you get stuck please look on-line (just cite your references). Python has many built-in methods for string manipulation, or write it with a for loop. Bonus points for removing punctuation and changing all text lower case.
My code so far:
orig_text = input("Enter a string to check if it is a palindrome: ")
if orig_text.replace(" ", "") == orig_text.replace(" ", "")[::-1]:
print(orig_text.replace(" ", ""),"sides reversed is",orig_text.replace(" ", "")[::-1], "\nso it is a palindrome."+ res)
else:
print(orig_text.replace(" ", ""), "is not a palindrome."+ res)