0

Whats wrong?

def intreverse(n): rev=0 while n>0: rev=(10*rev)+n%10 n//=10 return rev print(intreverse(1234))

2nd Feb 2017, 2:53 PM
Satyapriya Satyarthi
Satyapriya Satyarthi - avatar
4 Answers
+ 2
Look carefully at your code: the while loop ends returning 'rev'. Is this what you actually want to do?
2nd Feb 2017, 3:12 PM
Álvaro
+ 1
There's an indentation problem.
2nd Feb 2017, 3:06 PM
Álvaro
0
what will be the correct code?
2nd Feb 2017, 3:10 PM
Satyapriya Satyarthi
Satyapriya Satyarthi - avatar
0
got it corrected
2nd Feb 2017, 3:13 PM
Satyapriya Satyarthi
Satyapriya Satyarthi - avatar