Given a number x, where 1000≤x
Given a number x, where 1000≤x
Try this:
x = float(input())
if (x >= 1000 and x < 10000):
y = str(x)
print(y[::-1])
Here is a function to perform the inversion:
def reverse_number(n):
r = 0
while n > 0:
r *= 10
r += n % 10
n /= 10
return r