CodeTestValidate

No installations needed! Write Python directly in your browser and get instant feedback with our smart validation system.

Challenge # 6

Check Palindrome

Objective

Determine whether a given string is a palindrome.

Instructions

  • You are given a string variable s.

  • A palindrome is a string that reads the same forward and backward (e.g., 'madam', 'racecar').

  • Check whether s is a palindrome.

  • Print 'Palindrome' if it is, or 'Not palindrome' otherwise.

Constraints:
Do not use input(). • `s` will contain only lowercase letters and no spaces.
Exemple IO

Input: s = "madam"

Output: Palindrome

Input: s = "hello"

Output: Not palindrome

Input: s = "racecar"

Output: Palindrome

Try It Online!

Output:

Validate Your Results

Get your code reviewed and validated to understand what you did right and where you can improve.

Previous challengeCalculate FactorialNext challengeFind the Largest Number
Loading...