Skip to content

Detect given input is a palindrome Word or number. file contains of 2 programs Palindrome & Palindromify the list.

Notifications You must be signed in to change notification settings

arevish/palindrome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

1. Next Palindrome forthebadge

Problem Statement:-

A palindrome is a string that, when reversed, is equal to itself. Example of the palindrome includes:

676, 616, mom, 100001.

You have to take a number as an input from the user. You have to find the next palindrome corresponding to that number. Your first input should be the number of test cases and then take all the cases as input from the user.

Enter the number of test cases: 4
Please enter an input: 666
Please enter an input: mom
Please enter an input: hill
Please enter an input: 789
666 is a pallindrom
mom is a pallindrom
hill is not a palindrome

789 is not a palindrome
The next possible pallindrome is 797

2. Palindromify the List

The task you have to perform is “Palindromify the List.” The task is very similar to the previous one

Problem Statement:-

You are given a list that contains some numbers. You have to print a list of the next palindromes only if the number is greater than 17; otherwise, you will print that number.

Input: [1, 6, 87, 43]

Output: [1, 6, 88, 44]

PRE-REQUISITES

Your laptop with 3.6.x (onwards) installed.

NOTE: Those with Linux and MacOSX would have Python installed by default, no action required.

Windows: Download the version for your laptop via https://www.python.org/downloads/

NOTES In your preferred editor, make sure indentation is set to "4 spaces".

Run using Python3.8+

  1. Clone or download repositiory: https://github.com/arevish/palindrome.git
  2. In source folder, run python3 'palindrom.py' to start Next Pallindrome program, optionally, run with --help argument to see other runtime options.
  3. In source folder, run python3 'palindromifylist.py' to start Pallindromify the List program, optionally, run with --help argument to see other runtime options.

About

Detect given input is a palindrome Word or number. file contains of 2 programs Palindrome & Palindromify the list.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages