← Back to challenges

Automorphic Numbers

PythonHardalgebravalidationnumbers

Instructions

A number n is automorphic if n^2 ends in n.

For example: n=5, n^2=25

Create a function that takes a number and returns True if the number is automorphic, False if it isn't.

Examples

is_automorphic(5) ➞ True

is_automorphic(8) ➞ False

is_automorphic(76) ➞ True

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: YouTube Upload Count