Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Palindrome Function Writing
00:00
5 left

Palindrome Function Writing

EasyPython

Problem

Drw QA test labels occasionally use mirrored identifiers for fixture validation. Write a function that returns whether a string is a palindrome.

A palindrome reads exactly the same from left to right and right to left. Compare every character as provided: comparisons are case-sensitive, and spaces or punctuation count as characters.

Formal Specification

Implement is_palindrome(text).

  • Input: text, a string.
  • Output: True if text is a palindrome, otherwise False.

Constraints

  • 0 <= len(text) <= 100,000
  • text contains printable ASCII characters
  • Character comparison is case-sensitive
  • Spaces and punctuation are treated as ordinary characters

Function Signature

def is_palindrome(text):
Interviewer

Your question is Palindrome Function Writing. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.