Q: Project Euler problem 18: finding the best route in a triangular grid Project Euler problem 18 asks us to find the route from top to bottom of a triangular grid with the maximum sum.  
My program should be able to take in input as shown below. The number of test cases (2) appears on the first line, and then for each test case the number of rows is given (4) and then the data for the test case, one row per line.
2 
4 
3 
7 4
2 4 6
8 5 9 3
6
690
650 901
65 774 67
435 248 677 385
878 90 378 191 703
141 296 143 756 938 529

The program should produce one line of output for each test case, giving the route with the maximum sum:
23 
4176

I have tried to implement it using python.
The code is below:
def triangle(rows):
    PrintingList = list()
    for rownum in range (rows ):     
        PrintingList.append([])
        newValues = raw_input().strip().split()
        PrintingList[rownum] += newValues
    return PrintingList

def routes(rows,current_row=0,start=0): 
        for i,num in enumerate(rows[current_row]): 
            if abs(i-start) > 1:   
                continue
            if current_row == len(rows) - 1: 
                yield [num]
            else:
                for child in routes(rows,current_row+1,i):
                    yield [num] + child

testcases = int(raw_input())
for num in range(testcases):
    rows= int(raw_input())
    triangleinput = triangle(rows)
    max_route = max(routes(triangleinput),key=sum)
    sum(max_route)

When i type this:
1
3
1
2 3
4 5 6

I get this error:
Traceback (most recent call last):
  File "Maximum Route.py", line 23, in <module>
    max_route = max(routes(triangleinput),key=sum)
TypeError: unsupported operand type(s) for +: 'int' and 'str'

Need some guidance.. Do point out if there are other errors... Thanks...

A: Here's the problem:
newValues = raw_input().strip().split()

You need to convert your input to integers:
newValues = map(int, raw_input().split())

