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
app.py
1 2 3 4 5 6 7 8 9 10 11 |
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
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