```
class Solution(object):
def convertToBase7(self, num):
"""
:type num: int
:rtype: str
"""
return ('-' if num<0 else '')+''.join(str(x%7) for x in reversed([abs(num)/(7**i) for i in range(9) if abs(num)/(7**i)>0] if abs(num)>0 else [0]))
```