Skip to content

Instantly share code, notes, and snippets.

@thisfred
Created July 27, 2015 20:52
Show Gist options
  • Save thisfred/fa5fd8079e472ebdd955 to your computer and use it in GitHub Desktop.
Save thisfred/fa5fd8079e472ebdd955 to your computer and use it in GitHub Desktop.
from math import log
l = [1,23,456]
total = 0
x = 0
for n in reversed(l):
total += n * 10 ** x
x = int(log(total, 10)) + 1
print total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment