Skip to content

Instantly share code, notes, and snippets.

@souvikhaldar
Created February 12, 2019 17:37
Show Gist options
  • Save souvikhaldar/d58a6f9d0057ec56f557b56b79d42126 to your computer and use it in GitHub Desktop.
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.
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