Skip to content

About

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Palindrones

In this code challenge we check if a string entered by the user is a palindrome.

GitHub followers Twitter Follow
GitHub language count GitHub code size in bytes GitHub issues GitHub last commit GitHub branch checks state

Problem

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

Solution

A palindrome program is one of the easiest programs to write! In some programming languages reversing text is done in different ways, so in the code below we simply reverse it using the REVERSE keywords.

First, we get the user input, and then reverse the text and store the result in a new variable reversed_text.

text = INPUT
reversed_text = REVERSE text

After that, we check if the text entered is the same as the reversed text.

IF text = reversed_text THEN
    OUTPUT "The text you entered is a palindrome!"
ELSE 
    OTUPUT "The text you entered is NOT a palindrome!"

About

Write a program that checks if a string entered by the user is a palindrome. A palindrome is a word that reads the same forwards as backwards like “racecar" or "hannah".

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages