Data types · 25 / 29 Exercise Medium

Digits of a number

Objective

Create a Python program that separates the digits of a three-digit number using only arithmetic operations.

Instructions

  • Read a three-digit integer (between 100 and 999).
  • Show, on separate lines, the hundreds, the tens and the units. For example, 357 gives 3, 5 and 7.
  • Hint: use floor division // and the remainder %.
Input
357
Output
3
5
7

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise