My goal is to write a code that checks if a given string is a palindrome (same word forwards and backwards) and so far I have this
def is_palindrome(s):
string = s
if (string==string[::-1]):
print("The string IS a palindrome")
else:
print("The string is NOT a palindrome")
return
When I run these two asserts however, it only types out "The string IS a palindrome" once for the first assert and not "The string is NOT a palindrome" for the assert with 'house'
assert is_palindrome('noon')
assert not is_palindrome('house')
So for some reason that I can't see it must be only executing the function once. Can someone help me by telling me where the problem is?