Created
February 7, 2020 16:29
-
-
Save wiccy46/3e66a3954935775a51ef9def230cbdfe to your computer and use it in GitHub Desktop.
[reverse_number] Reverse a number #python
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
n = 1234 | |
rev=0 | |
while(n>0): | |
dig=n%10 | |
rev=rev*10+dig | |
n=n//10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment