3) Prompt the user for a 3-digit number, and the output should be the magical #, which is formed with each digit shifted to the left by one place. For example, if the user enters 512, the outputshould be 125. this is in python

Respuesta :

num = int(input("Enter a 3-digit number: "))

first = num//100

second = (num - (first*100)) //10

third = (num - ((first * 100) + (second *10)))

new_num = second*100 + third*10 + first

print(new_num)

I hope this helps!