Python one-liner with numpy for fun :)
\n\nimport numpy as np\nclass Solution:\n    def convertToBase7(self, num: int) -> str:\n        return np.base_repr(num, base=7)\n
\n```\nimport numpy as np\nclass Solution:\n    def convertToBase7(self, num: int) -> str:\n        return np.base_repr(num, base=7)\n```
['Python3']