Skip to main content

Python Program To Check Palindrome Number

If you want python program to check palindrome number then you are at right place. As python is the future of the technology, we all want to become a master in this programming language. Let’s start with the basic.

Python Program To Check Palindrome Number

Here we are going to tell how you can write a simple program which checks whether a given number is a palindrome or not. It is quite simple using reverse function of python but here, we will have a given number and our goal is to find out the palindrome number by doing some calculation (without using reverse function). You will gain the concept of input / output statement and practice the control statements.

 

Example:

Input:

Enter a number: 1331

 

Output:

Number is palindrome

 

Input:

Enter a number: 78900987

 

Output:

Number is palindrome

 

Task:

For given Pseudo-Code Magnets arrange it in correct order and complete

 

Pseudo-code Magnets:

Number=Number%10

Remainder=Number/10

while (Number! =0) do

if(Temp==Reverse) then

Temp=Number

else

Reverse=0

Number=Number/10

display "Palindrome"

while(Number==0) do

Reverse=Reverse*10+Remainder

Reverse=Remainder*10+Reverse

input Number

end-while

 

Remainder=Number%10

end-if

display "Not a Palindrome"

 

Program to check palindrome number:

# To Check whether no. is palindrome 

num = int(input("Enter a number: "))
temp = num
reverse = 0
while(num!=0):
    remainder = num % 10
    reverse = reverse*10 + remainder
    num = num//10
    
if(temp==reverse):
    print("Number is palindrome")
else:
    print("Number is not a palindrome")

 

Output:

 Python Program To Check Palindrome Number


   Python Program To Check Palindrome Number


 

Note: If you have any doubt regarding the program, you can mention them in the comment section.

 

Comments

Popular posts from this blog

How To Create PAN Card Online

If you want to know  how to create a PAN card online  and  how to get a PAN card at your home  then you are in right place. As the traditional process of getting a PAN card is a hectic process, which involves customers visiting an off-site bank, taking application, filling it and then the submission is another hectic story. So, to prevent this you can apply for a PAN card online . PAN card online free : Permanent Account Number (PAN) is the main card utilized during each banking and monetary exchange. On the off chance that your PAN card has not yet been made and you need another one, then, at that point, this news is significant for you. We tell you how to get a PAN card online free and where to apply. PAN Card is a significant report for monetary or banking-related work as it's viewed as quite possibly the most essential of the document. This is the explanation government is continually making proactive and basic strides so that individuals can undoubtedly get ...

Dahi Handi Celebration in 2021

The much-excited festival of  Dahi Handi  is done per day after  Krishna Janmashtami  or  Gokulashtami . On this day, young men structure a human pyramid to break an earthen pot (or handi) that is loaded up with new margarine or curd and hung at a marginally hard to-arrive at tallness. The game impersonates Lord Krishna's youth demonstrations of taking maakhan. The day is praised all the more prevalently in  Gujarat  and  Maharashtra. Dahi Handi Significance And Dates The Dahi Handi celebration recognizes Lord Krishna's happy lifestyle. As a youngster, Lord Krishna was very devilish and incredibly attached to having spread and curd. With taking a break, his affection for spread and curd expanded and he began taking it in a great manner, even as ladies of the local area hung it high to guard it. In any case, the high Dahi Handis weren't protected from Lord Krishna and his companions, who framed human pyramids to arrive at the pots. This addi...

Binary Trading

We let you know why we use data representation in binary trading and discuss three main ways that we can generate a binary dataset for binary trading. Simultaneously we will also discuss  the characteristics of natural  binary trading  algorithms and  talk about the characteristics of our AI algorithms. If we stop using symbols to represent binary data then we are pretty much to the fundamental character. What exactly constitutes binary data such as the capital salary of a guy which goes through our database because it contains this name or his place of birth? Does a response method in the UDF for answering these questions look like “not so much”? Well, that was because for us to answer questions like that then we would think differently of our data and related them to the characters of symbols but even then, we never needed data representation at first. So, what exactly is a binary dividend? It refers to two statements. Input: V. It's fundamental. We needed thi...