Jump to content

Featured Replies

Posted

Challenge:

Write a program that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or sequence of characters that reads the same backward as forward, ignoring spaces, punctuation, and capitalization.

Requirements:

  1. Accept user input for the string.
  2. Normalize the string by removing non-alphanumeric characters and converting it to lowercase.
  3. Check if the normalized string is a palindrome.
  4. Print True or False based on the result.

Bonus:

  • Extend the program to handle numeric palindromes (e.g., 12321).
  • Allow the user to check multiple strings in one run.

Example Output:

  1. Input: "A man, a plan, a canal, Panama!"
    Output: True
  2. Input: "Hello, World!"
    Output: False
  • Views 142
  • Created
  • Last Reply

Create an account or sign in to comment

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.