Reverse A Number Leetcode Solution Python