← Back to challenges

Length of Number

PythonHardnumbers

Instructions

Create a function that takes a number num and returns its length.

Examples

number_length(10) ➞ 2

number_length(5000) ➞ 4

number_length(0) ➞ 1

Notes

The use of the len() function is prohibited.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Get Students with Names and Top Notes