Skip to content

AdaGold/palindrome_check_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Palindrome Check in Python

In this assignment, you'll design and implement one of the string manipulation functions that is commonly asked during interviews.

Exercise

  • Design and implement a function that checks if the input string is a palindrome. The function should return True if the input string is a palindrome, and return False if it is not a palindrome.
  • Share and explain the time and space complexities for your solution.
  • At minimum, your implementation should pass the basic tests.

Note 1: A palindrome is a word, phrase or sentence that reads the same backwards as it does forwards. e.g. "madam"

Note 2: Do not use Python provided functionality for reversed(), reverse(), or string slicing ("string"[::-1]). You may use len().

Running the Tests

Install pytest

pip install pytest

To run all tests, navigate to the same directory as the test file and run:

pytest test_palindrome_check.py

Alternatively, to exit instantly on first error or failed test, run:

pytest -x test_palindrome_check.py

See pytest documentation for more information about pytest.

About

Python version of checking if a string is a palindrome

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages