Automorphic Number

Published by Mubashir Hassan in

A number is called Automorphic number if its square ends in the original number. Create a function that takes a number n and returns True if it is an Automorphic number, otherwise False.

Examples

automorphic(1) ➞ True

automorphic(3) ➞ False
# 3^2 = 9

automorphic(6) ➞ True
# 6^2 = 36 (ends with 6)

automorphic(95) ➞ False
# 95^2 = 9025 (does not end with 95)

Notes

N/A

Watch a quick demo on how Edabit works.