Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
original_code = int(input("Positive code: "))
reversed_code = 0
remaining = original_code
while remaining > 0:
reversed_code = reversed_code * 10 + (remaining % 10)
remaining //= 10
print("Reversed:", reversed_code)