Interview Question

Check palindrome

A basic palindrome check compares normalized text with its reverse.

💡 Concept ✅ Quick Revision 🐍 Python

Answer

A palindrome reads the same forward and backward under the chosen normalization rules. • A basic check compares a sequence with its reverse. • Real input may require case folding and removal of punctuation or spaces. • Define normalization before claiming two strings match.

💡 Simple Example

text = 'level' print(text == text[::-1])

Output

True

⚡ Quick Revision

A basic palindrome check compares normalized text with its reverse.