# Even more lists and loops solution

Overview

Part 1: Functions that change a list

In this part, you will use two inputs corresponding to two people walking in a grid of (x,y) coordinates. You know their starting point and the path they took. Here is an example input: Wallace,2,2,up,left,stay which means that: • Wallace was initially at point (2,2).
• Then, he walked up at time 1 to position (2,3).
• Then, he walked left at time 2 to position (1,3).
• Then, he stayed at his current position (1,3) time 3. Your job is to read two strings corresponding to the two paths using raw_input and then use this information to print the location of each person and the grid distance between them (total number of grid segments in between) for each time point. For example, the distance between (5,4) and (2,3) is given by (5-2)+(4-3)=4. Finally, print the max and min distance between the two individuals during their walk. Clearly, you will need to use the split function to process the input strings. Here is a sample output: Enter the first path == Wallace,2,2,up,left,stay,up,right,stay,up,right Wallace,2,2,up,left,stay,up,right,stay,up,right Enter the first path == Gromit,5,4,down,down,left,stay,left,left,down,down Gromit,5,4,down,down,left,stay,left,left,down,down Wallace Action Gromit Action Distance (2,2) initial (5,4) initial 5 (2,3) up (5,3) down 3 (1,3) left (5,2) down 5 (1,3) stay (4,2) left 4 (1,4) up (4,2) stay 5 (2,4) right (3,2) left 3 (2,4) stay (2,2) left 2 (2,5) up (2,1) down 4 (3,5) right (2,0) down 6 The minimum distance between them is 2 The maximum distance between them is 6 Remember. Correctness and good program structure will be a big part of your grade. You must use a list for a person’s current location, i.e [1,2]. You must use a function to ﬁnd the next location of a person by changing the input location and the current command (up, down, left, right, stay). Your function must not return a value, but modify the input location list. You do not have to match the spacing in the output exactly, but your columns must be aligned. The above output uses 11 spaces between all columns. Once you are sure your program works correctly, turn in only your code named as hw5_part1.py.

Part 2 - Bunnies and Foxes, equilibrium