Integer18. Given an integer greater than 999. Using one integer division operation and one operation taking the remainder of the division, find the digit corresponding to the thousands in the designation of this number.

Solution in Python 3:

import random

N = random.randrange(1000,1000000)
print("Number: ", N)
d1 = int(N/1000)
d2 = d1%10
print("Division by 1000: ", d1)
print("The remainder of the division by 10: ", d2)
print(The digit in the 1000th position: ", d2)