subject
Engineering, 23.10.2019 23:00 alexius6608

#read the dimension of the grid dim = in_file. readline() dim = dim. strip() dim = int(dim) # create an empty grid grid = [] # populate the grid for i in range (dim): line = in_file. readline() line = line. strip() row = line. split() for j in range (dim): row[j] = int (row[j]) grid. append (row) # close the file in_file. close() # get the number of paths in the grid and print num_paths = count_paths (dim, 0, 0) print ('number of paths in a grid of dimension', dim, 'is', num_paths) print () # get the maximum path sum and print max_path_sum = path_sum (grid, dim, 0, 0) print ('greatest path sum is', max_path_sum)

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 16:10
The force on a cutting tool are 2600n vertically downward and 2100 horizontal. determine the resultant force acting on the tool and the angle at which it acts.
Answers: 1
question
Engineering, 04.07.2019 18:10
What difference(s) did you notice using a pneumatic circuit over hydraulic circuit.explain why the pneumatic piston stumbles when it hits an obstacle.
Answers: 2
question
Engineering, 04.07.2019 18:10
Steel is coated with a thin layer of ceramic to protect against corrosion. what do you expect to happen to the coating when the temperature of the steel is increased significantly? explain.
Answers: 1
question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
You know the right answer?
#read the dimension of the grid dim = in_file. readline() dim = dim. strip() dim = int(dim) # create...
Questions
Questions on the website: 13722360