I am getting a **Wrong Answer** for my solution to [this problem](http://www.spoj.com/problems/CUBERT/) on SPOJ. 

The problem asks to calculate the cube root of an integer(which can be upto 150 digits long), and output the answer truncated upto 10 decimal places.  

It also asks to calculate the sum of all the digits in the answer modulo 10 as a 'checksum' value. 

Here is the exact problem statement: 

> 
> Your task is to calculate the cube root of a given positive integer.
>  We can not remember why exactly we need this, but it has something in
>  common with a princess, a young peasant, kissing and half of a kingdom
>  (a huge one, we can assure you).
> 
> 
> Write a program to solve this crucial task. 
> 
> 
> **Input**
> 
> 
> The input starts with a line containing a single integer t <= 20, the
>  number of test cases. t test cases follow.
> 
> 
> The next lines consist of large positive integers of up to 150 decimal
>  digits. Each number is on its own separate line of the input file. The
>  input file may contain empty lines. Numbers can be preceded or
>  followed by whitespaces but no line exceeds 255 characters.
> 
> 
> **Output**
> 
> 
> For each number in the input file your program should output a line
>  consisting of two values separated by single space. The second value
>  is the cube root of the given number, truncated (not rounded!) after
>  the 10th decimal place. First value is a checksum of all printed
>  digits of the cube root, calculated as the sum of the printed digits
>  modulo 10.
> 
> 
> **Example**
> 
> 
> **Input**:  
> 
>  5  
> 
>  1 
> 
> 
> 8
> 
> 
> 1000
> 
> 
> 2 33076161
> 
> 
> **Output**:  
> 
>  1 1.0000000000  
> 
>  2 2.0000000000  
> 
>  1 10.0000000000  
> 
>  0 1.2599210498  
> 
>  6 321.0000000000
> 
> 
> 

Here is my solution: 

```
from math import pow

def foo(num):
    num_cube_root = pow(num, 1.0 / 3)
    # First round upto 11 decimal places
    num_cube_root = "%.11f" % (num_cube_root)
    # Then remove the last decimal digit
    # to achieve a truncation of 10 decimal places
    num_cube_root = str(num_cube_root)[0:-1]

    num_cube_root_sum = 0
    for digit in num_cube_root:
        if digit != '.':
            num_cube_root_sum += int(digit)
    num_cube_root_sum %= 10

    return (num_cube_root_sum, num_cube_root)

def main():
    # Number of test cases
    t = int(input())
    while t:
        t -= 1
        num = input().strip()
        # If line empty, ignore
        if not num:
            t += 1
            continue

        num = int(num)
        ans = foo(num)
        print(str(ans[0]) + " " + ans[1])

if __name__ == '__main__':
    main()

```

It is working perfectly for the sample cases: [Live demo](http://ideone.com/WHhONm). 

Can anyone tell what is the problem with this solution?