Objective

Create a program that allows the user to choose from a given range of arithmetic operations, and then performs that operation on two input numbers.

Difficulty

Easy

Description

A palindrome is a word that reads the same forwards and backwards.

For example, 'ada' is a palindrome. If you read it forwards, it's 'ada'; and similarly, if you read it backwards, it's still 'ada'. Since it's same in both directions, it's a palindrome.

Now, consider the word 'bulb'. Forwards, it's read as 'bulb'. But backwards, it's read as 'blub'. Since both these directions yield different words, 'bulb' is not a palindrome.

By this means, every single letter is a palindrome as well. 'a' is a palindrome, 'b' is a palindrome, and so on and so forth.

In this exercise, you have to create a program that asks the user to enter a word, and then outputs backs 'Yes' if it is a palindrome, or otherwise 'No'.

You must create a function for this exercise.

The input prompt asking for the word shall be as follows:

Enter a word: <word>

where <word> denotes the word entered by the user to be run against a palindrome check.

Shown below are two examples:

Enter a word: ada
Yes
Enter a word: bulb
No

Hints