Programming Examples
Python program to take a 2 digit number and then print the reversed number
Write a program to take a 2-digit number and then print the reversed number. That is, if the input given is 25, the program should print 52.
Solution
Solution
x = int(input("Enter a two digit number: "))
y = x % 10 * 10 + x // 10
print("Reversed Number:", y)
Output/ Explanation:
Enter a two digit number: 25
Reversed Number: 52