So basically the question:
Write a program that determines whether phrases are palindromes or not.
This:
rotor
gnu dung
O Geronimo, no major ego.
Ten animals we slam in a net.
Harpo: not on Oprah?
Should produce this:
Yes "rotor"
Yes "gnu dung"
No "O Geronimo, no major ego."
No "Ten animals we slam in a net."
Yes “Harpo: not on Oprah?”
My code is this:
p=input(“Phrases”)
lp=len§
f=f in range (0,lp,1)
b=b in range (lp,0,-1)
if p[f]==p[b]:
print(“Yes”,p)
else:
print(“No” ,p)
I get this error when I enter “tacocat” as test data.
Traceback (most recent call last):
File “python”, line 1, in
File “”, line 1, in
NameError: name ‘tacocat’ is not defined
I’m not sure why. Help?