← Back to challenges

Square Every Digit

PythonHardnumbersalgorithmsmathlanguage_fundamentals

Instructions

Create a function that squares every digit of a number.

Examples

square_digits(9119) ➞ 811181

square_digits(2483) ➞ 416649

square_digits(3212) ➞ 9414

Notes

The function receives an integer and must return an integer.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Travelling Salesman Problem