1.4. Homework#

We can calculate how many digits there are in a number by repeatedly dividing by 10 until the number is less than one.

  1. Write pseudo-code for this calculation.

  2. Write a Python program to implement it, displaying the result in the format 1234 has 4 digits.

  3. Test your program with a variety of numbers.

  4. Extend your program so that it works for negative numbers.