Created
April 19, 2018 13:58
-
-
Save jesuyedavid/627a50070f57a29e6f7c70736186f48b to your computer and use it in GitHub Desktop.
Reverse print a digit using recursion
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 recRev(x, y): | |
if(x>0): | |
y+=x%10 | |
return (recRev(x/10, y*10)) | |
else: | |
return (y/10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment