Return to Snippet

Revision: 27079
at May 21, 2010 10:46 by chroto


Initial Code
#!/usr/bin/python

# Project Euler - Problem 15

print "\nProject Euler - Problem 15"
print "Find the number of paths in a 20x20 grid to the bottom right corner.\n"

x= []
grid = 20

for i in xrange(grid+1):
    x.append([1])
    x[0].append(1)

for m in range(1,grid+1):
   for n in range(1,grid+1):
       x[m].append(x[m-1][n] + x[m][n-1])

print x[grid][grid]

Initial URL


Initial Description


Initial Title
Project Euler - Problem 15

Initial Tags


Initial Language
Python