Python 3 Script to Check Whether a Number is Palindrome or Not Full Project For Beginners

Python 3 Script to Check Whether a Number is Palindrome or Not Full Project For Beginners

 

Welcome folks today in this post we will be checking whether a number is palindrome or not in python. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started just make an app.py file and copy paste the following code

See also  Python 3 Script to Extract Numbers & Email Addresses From String Using Regular Expression Full Project For Beginners

 

app.py

 

n=int(input("Enter number:"))
temp=n
rev=0
while(n>0):
    dig=n%10
    rev=rev*10+dig
    n=n//10
if(temp==rev):
    print("The number is a palindrome!")
else:
    print("The number isn't a palindrome!")

 

 

Now if you execute this python script by typing the below command

See also  Python 3 Selenium Web Scraping Script to Take Screenshot of Website URL and Download it as PNG Image File Full Project For Beginners

 

python app.py

 

Now it will ask you to enter a number in order to check if it is palindrome or not

 

 

So now as you can see 11 is a palindrome number

Leave a Reply