FAQ: Recursion vs. Iteration - Coding Throwdown - Taco Cat


This community-built FAQ covers the “Taco Cat” exercise from the lesson “Recursion vs. Iteration - Coding Throwdown”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn Recursion: Python

FAQs on the exercise Taco Cat

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


I found a bug in this lesson.

Whenever I run the code I wrote, it tells me I pass, and I did, but it shows the last print call to be True when it is actually False. Even the print calls I use to compare the two characters show they are DIFFERENT, it still evaluates to True when I compare them.

def is_palindrome(word):
  if len(word) < 2:
    return True
  if word[0] != word[-1]:
      return False
  return is_palindrome(word[1:-1])

# test cases
print(is_palindrome("abba") == True) 
print(is_palindrome("gmcmg") == True)
print(is_palindrome("") == True)
print(is_palindrome("abcd") == False) # Prints True when it is False.


Ah, it’s checking if “abcd” == False if “abcd” == False then this is True. You want all Trues because it means that your code works when it is supposed to and catches the False when it is suppose to.

It’s checking if your function produces a False when “abcd” is passed in. If it does this will print True. If “abcd” produces a True then “abcd” does not == False and it would say False and your code is not doing something it’s supposed to.

:upside_down_face: Hope this made some sense.


Soon as I read your first 7 words, it hit me! I was thinking, for some idiotic reason, that the == False areas of the statements were showing me what it SHOULD be.

Thanks for slapping me in the face and waking me up! I swear, coding for 13 hours makes you get loopy and miss things. Thanks you!