Skip to content

Instantly share code, notes, and snippets.

@avances123
Last active November 23, 2016 07:14
Show Gist options
  • Save avances123/e92943dcdff3f4036f1038269b949be8 to your computer and use it in GitHub Desktop.
Save avances123/e92943dcdff3f4036f1038269b949be8 to your computer and use it in GitHub Desktop.

Problem

Use a git repository, when you start make your first commit, try to commit as much as possible. Make the repository publicly viewable and share the link with me.

  1. Make a function than get an integer and reverse it without using text or lists
Ex. f(130) = 31
from math import ceil, log10
num = int(input("Enter a number: "))
result = ''
for i in range(int(ceil(log10(num)))): # => how many digits in the number
num, remainder = divmod(num, 10)
result += str(remainder)
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment