a guest Sep 18th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def x(s):
  2.   res = 0
  3.   for idx, item in enumerate(reversed(s)):
  4.     for num in range(1, 10):
  5.       if str(num) == item:
  6.         res += num * (10 ** idx)
  7.   return res
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand