def base(num,base):
    """
    Input: num can be any base 10 integer, base can be any positive integer<=10.

    Output: num is returned as a string in the specified base integer.
    """
    from math import log
    
    # Create a list of all possible digits
    digits=[x for x in range(base)]
    
    # Solve for highest base power
    highestExponent=int(log(num,base))

    # Create base expansion list from greatest to least
    baseExpansionList=[base**x for x in range(highestExponent+1)]
    baseExpansionList.reverse()

    # Get digits in base
    newDigits=[]
    for x in baseExpansionList:
        tmp=getDigits(num,x,digits)
        num=num-(tmp*x)
        newDigits.append(tmp)

    # Convert newDigits to str format
    numStr=""
    for x in newDigits:
        numStr+=str(x)
    return numStr

    Input: num can be any base 10 integer, base can be any positive integer<=10.

    Output: num is returned as a string in the specified base integer.
    
recipes/Python/578630_Convert_decimal_basen_any_positive_n_less_thor/recipe-578630.py