Created
May 16, 2019 04:33
-
-
Save AwesomeZaidi/760db7e7f939ad5e1ae0c3bded015ce5 to your computer and use it in GitHub Desktop.
Mystery Python Puzzle 2
This file contains 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
import string | |
import sys | |
def puzzle(ds, b): | |
v = {c: i for i, c in enumerate(string.printable[:36])} | |
return sum(v[d] * b**e for e, d in enumerate(ds[::-1])) | |
if __name__ == '__main__': | |
print puzzle(sys.argv[1], int(sys.argv[2])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment