Finding Maximum route with different triangles
<p>I need to find the maximum route of a triangle. I earlier posted this <a href="http://stackoverflow.com/questions/10053540/finding-the-maximum-route-in-a-given-input.Now">Finding the Maximum Route in a given input</a> i am implementing it so that it can take multiple tries with different values each time. I seem to have an error.. Need some help on it... I am using Python 3.2.2</p>

<p>Code: </p>

<pre><code>numOfTries = raw_input("Please enter the number of tries")
Tries = int(numOfTries)
for count in range(Tries):
    numstr= raw_input("Please enter the height:")
    rows = int(numstr)
    triangle(rows)
    routes(triangle)
    max(routes(triangle),key=sum) 
def triangle(rows):
    for rownum in range (rows):
        PrintingList = list()
        print ("#%d row") % rownum
        for iteration in range (rownum):
            newValue = raw_input("Please enter the %d number:") %iteration
            PrintingList.append(int(newValue))
            print()
def routes(rows,current_row=0,start=0):
           for i,num in enumerate(rows[current_row]): #gets the index and number of each number in the row
                if abs(i-start) &gt; 1:   # Checks if it is within 1 number radius, if not it skips this one. Use if not (0 &lt;= (i-start) &lt; 2) to check in pyramid
                    continue
                if current_row == len(rows) - 1: # We are iterating through the last row so simply yield the number as it has no children
                    yield [num]
                else:
                    for child in routes(rows,current_row+1,i): #This is not the last row so get all children of this number and yield them
                         yield [num] + child 
</code></pre>

<p>Error: </p>

<pre><code>Traceback (most recent call last):
  File "&lt;pyshell#2&gt;", line 1, in &lt;module&gt;
    numOfTries = raw_input("Please enter the number of tries")
NameError: name 'raw_input' is not defined
</code></pre>

<p>Any help is appreciated.</p>
