Feb-12-2021, 09:45 PM
Hi everyone i am beginner in python i am facing with this exercice can anyone explained how to write this in Python :
Exercice :
-----------------------------
Write a function reverse that receives an integer n as a parameter and returns that integer as result backwards. For example, if n = 123456, the function returns 654321.
For that, it will be necessary to use the division and the modulo. Reminder: 153% 10 = 3 and 153/10 = 15.
Remember to handle the case n < 0.
-----------------------------------
I hope got answer from u guys.
Thank u in advanced.
Exercice :
-----------------------------
Write a function reverse that receives an integer n as a parameter and returns that integer as result backwards. For example, if n = 123456, the function returns 654321.
For that, it will be necessary to use the division and the modulo. Reminder: 153% 10 = 3 and 153/10 = 15.
Remember to handle the case n < 0.
-----------------------------------
I hope got answer from u guys.
Thank u in advanced.