n = 1486743242498701
while n != 0:
print('The last digit:', n % 10, end=' => ')
n //= 10
print('Resulting n:', n)
The last digit: 1 => Resulting n: 148674324249870
The last digit: 0 => Resulting n: 14867432424987
The last digit: 7 => Resulting n: 1486743242498
The last digit: 8 => Resulting n: 148674324249
The last digit: 9 => Resulting n: 14867432424
The last digit: 4 => Resulting n: 1486743242
The last digit: 2 => Resulting n: 148674324
The last digit: 4 => Resulting n: 14867432
The last digit: 2 => Resulting n: 1486743
The last digit: 3 => Resulting n: 148674
The last digit: 4 => Resulting n: 14867
The last digit: 7 => Resulting n: 1486
The last digit: 6 => Resulting n: 148
The last digit: 8 => Resulting n: 14
The last digit: 4 => Resulting n: 1
The last digit: 1 => Resulting n: 0