Integer15. A three-digit number is given. Output the number obtained by swapping the digits of hundreds and tens of the original number (for example, 123 will become 213).

Solution in Python 3:

import random

N = random.randrange(100,1000)
print("Number: ", N)
d2 = int(N/100)
d1 = int((N-d2*100)/10)
d0 = N%10
print("Hundreds: ", d2)
print("Tens: ", d1)
print("Units: ", d0)
print("Another number: ", d1*100 + d2*10 + d0)