Calculating the number ( n ) by taking mod with the base and adding remainder to the result and parallelly reducing the num value .
while ( n > 0 ) : NEW_LINE INDENT remainder = n % base NEW_LINE result = result + remainder NEW_LINE n = int ( n / base ) NEW_LINE DEDENT