
A word, phrase, or sequence that reads the same backwards as forwards, e.g. madam.
Iterative Approach
An iterative approach is based around the use of a loop which can be:
- A count-controlled loop (e.g. FOR loop)
- A condition-controlled loop (e.g. WHILE loop or REPEAT UNTIL loop)
For our iterative palindrome check algorithm, we will use a loop to check all the letters in the first half of the word and compare them with the letters in the second half of the word (in reverse order). If they all match then the word is a palindrome.
Recursive Apporach
A recursive function is a function that:
- Includes a call to itself,
- Has a stopping condition to stop the recursion.
For our recursive palindrome check algorithm, we will use a function that:
- Checks that the word is at least two characters long:
- If the word is less than two characters then the function will stop the recursion (stopping condition) and Return True as the word is a palindrome.
- If the word is two or more characters long, the function will check that the first and last letter of the word are the same:
- If they are the same, the function will extract the word in the middle (remove the first and the last letter) and call itself with this new shortest word.
- If they are different, then the word is not a palindrome. The function will stop the recursion here (stopping condition) and return False.
You can visualise/trace this recursive function on recursionvisualizer.com
Your Task
Complete the following factorial challenge using both an iterative approach and a recursive approach.

Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area
We have all heard of the famous English pirate called Blackbeard who sailed the seven seas during the XVIII century. Through his numerous acts of piracy, Blackbeard accumulated a huge collection of riches including golden coins, jewels, golden plates and precious stones. Blackbeard was wise enough not to carry his treasure on his vessel. Instead he buried his treasure in a secret location, somewhere in the middle of the Pacific Ocean. 

The rail fence cipher (sometimes called zigzag cipher) is a transposition cipher that jumbles up the order of the letters of a message using a basic algorithm.






In this challenge we will use the Luhn Algorithm to check if a debit card or credit card number is a valid card number.












