# # a recursive function to check for palindromes # Matt Bishop, MHI 289I, Fall 2020 # def palin(s): # base case: empty string if s == "": return True # recursive case # 1. see if the first and last letter # are the same; if not, return False if s[0] != s[-1]: return False # 2. Now return whether the middle part # is a palindrome return palin(s[1:-1])