60. Python Program to find the given number is Automorphic or Not.
How does this program work?
- In this program you are going to learn about to check if a number is Automorphic number or not using Python.
- An Automorphic number is a number whose square ends with the number itself.
- First find the square of a number itself, After that check the condition followed by given logic then we get the Output.
Here is the code
a = int(input("Enter the number: "))
b = a*a
print("Square of a number is: ",b)
if(a % 10 != b % 10):
print(a," is not an automorphic")
a=10 #(a = a/10)
b=10 #(b = b/10)
else:
print(a, "is an automorphic")