human
Solve in Python:
Given an integer, return its base 7 string representation.

Example 1:

Input: 100
Output: "202"


Example 2:

Input: -7
Output: "-10"


Note:
The input will be in range of [-1e7, 1e7].

=====
What is a the Python code you requested?
assistant
#Here is the Python code you requested.

class Solution:
     def convertToBase7(self, num):
         """
         :type num: int
         :rtype: str
         """
         L = []
         n = abs(num)
         while n >= 7:
             L.append(str(n % 7))
             n = n // 7
         L.append(str(n))
         return "".join(L[::-1]) if num >= 0 else "-"+"".join(L[::-1])