top of page

PROGRAMMING CHALLENGES

Palindrome Checker

Difficulty:

2 Medium

5 Iteration (for loops)

Topic:

Write a program that checks if a given string is a palindrome (a word, phrase, number, or other sequence of characters that reads the same backward as forward).

INPUTS: String (string)

PROCESSES:
1. Accept user input for the string
2. Convert the string to lowercase and remove non-alphanumeric characters
3. Use two for loops to iterate through the string from the beginning and end
4. Compare the characters at the corresponding positions
5. If a mismatch is found, break out of the loop and indicate that the string is not a palindrome
6. If no mismatch is found, indicate that the string is a palindrome

OUTPUTS: Message indicating whether the string is a palindrome or not (string)

Need help with your programming skills?

If you need more help than just independent practise, then we're here for you. Book a 1:1 with us and we will be able to guide you to becoming a proficient programmer who can tackle any of the challenges an exam board can throw at you.

bottom of page