Ad
Code
Diff
  • def palindrome(string):
        
        for i in range(0, int(len(string) / 2)):
            if string[i].lower() == string[-i - 1].lower():
                continue
            else:
                return False
        return True
    
    • def palindrome(string):
    • middle = int(len(string) / 2)
    • is_palindrome = False
    • for i in range(0, middle):
    • for i in range(0, int(len(string) / 2)):
    • if string[i].lower() == string[-i - 1].lower():
    • is_palindrome = True
    • continue
    • else:
    • is_palindrome = False
    • return is_palindrome
    • return False
    • return True