Created
February 12, 2019 17:37
-
-
Save souvikhaldar/d58a6f9d0057ec56f557b56b79d42126 to your computer and use it in GitHub Desktop.
Function intreverse(n) that takes as input a positive integer n and returns the integer obtained by reversing the digits in n.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def intreverse(n): | |
a="" | |
while n>0: | |
b=str(n%10) | |
a=a+b | |
n=n//10 | |
return int(a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment