Integer16. A three-digit number is given. Output the number obtained by swapping the digits of tens and units of the original number (for example, 123 will go to 132).

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: ", d2*100 + d0*10 + d1)