Code Monkey home page Code Monkey logo

palindrome's Introduction

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.

palindrome's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.