Write a function (or equivalent subprogram) to accept a single integer valued argument and return a (similarly typed) value found by reversing the order of the base-10 digits of the argument.
For example given 76543 return 34567
Write a function (or equivalent subprogram) to accept a single integer valued argument and return a (similarly typed) value found by reversing the order of the base-10 digits of the argument.
For example given 76543 return 34567
I decided to make a function instead of hardcoding it.
def r(n):print(int(str(n)[::-1]))
The code is pretty self-explanatory.
Usage: r(12345)
SELECT 0+REVERSE(:1||'')FROM DUAL;
a=b=>b.split("").reverse().join("")
b
is an integer.
\$\endgroup\$
Commented
Jul 4, 2015 at 18:54