Much simple and readable.
\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        mult,add=1,0\n        for i in str(n):\n            mult*=int(i)\n            ad
```\nclass Solution:\n    def subtractProductAndSum(self, n: int) -> int:\n        mult,add=1,0\n        for i in str(n):\n            mult*=int(i)\n            add+=int(i)\n        return mult-add\n```
['Python', 'Python3']