How to reverse digits of a given number using Python program, this post has solved program with explanation.
Python Code:
1 2 3 4 5 6 7 8 9 10 11 12 | # Python Program to Reverse a Number using While loop Number = int(input("Please Enter any Number: ")) Reverse = 0 while(Number > 0): Reminder = Number %10 Reverse = (Reverse *10) + Reminder Number = Number //10 print("\n Reverse of entered number is = %d" %Reverse) |