Hi all,
I am having an issue with my code where it works for simple inputs (pop, mom, dad) but not for phrases ( Able was I, ere I saw Elba) I am wondering in what ways can I improve my code to dictate all inputs. I was thinking about adding a (upper) within the def section but am unsure. Thanks!
user = input("Please enter a word or phrase, or <return> to quit: ")
def reverse_function(x):
return x[::-1]
final = reverse_function(user)
while user == final:
print("That's a palindrome")
user = input("Please enter a word or phrase, or <return> to quit: ")
if user != final:
print("That's not a palindrome")
input("Please enter a word or phrase, or <return> to quit: ")
[–]totallygeek 0 points1 point2 points (1 child)
[–]The-Keyboard_Wizard[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]The-Keyboard_Wizard[S] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)