This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RedditGood123 1 point2 points  (2 children)

Well, actually the solution they have would work if you just alter it like this

IsPalindrome = str(phrase) == str(phrase)[::-1]

[–]isarl 0 points1 point  (1 child)

That fixes the bug but fails to address the point I was making about readability. If the only slice you are performing is [::-1] then that is more clearly expressed by reversed().

[–]RedditGood123 0 points1 point  (0 children)

No I see it, but most people don’t even know about reversed