CodeField

Repeat it

Task 7 of 7

Write

Read a whole number of 1 or more, and print how many digits it has. This task practises loops, so your program must use one.

  • Example: 4096 gives 4
  • Example: 7 gives 1

Your program, Python

Tab indents. To leave, press Escape, then Tab.

Compare it with a model answer now, or come back on a device that can run Python.

Python for this device

Writing tasks run your program on this device. That needs Python: 5.5 MB, once. About 2 minutes on 3G, about 8 on a slow connection. It stays on this device. Remove it in Settings at any time.

You can do the other tasks while it downloads.