Skip to content

Wrong palindrome implementation #12941

@sibebleuze

Description

@sibebleuze

Repository commit

9d52683

Python version (python --version)

Python 3.13.7

Dependencies version (pip freeze)

/

Expected behavior

in https://github.com/TheAlgorithms/Python/blob/master/strings/palindrome.py
function is_palindrome_recursive - first if statement is wrong - not all 2 letter strings are palindromes
should be if len(s) <= 1: return True

> is_palindrome_recursive('abcdba')
False

Actual behavior

> is_palindrome_recursive('abcdba')
True

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions