 In this video, I'll be explaining one solution to lesson three practice exercise D in which we need to select park and ride facilities in a given target city and export them to a new feature class. And this solution will have a lot of elements that were used in exercises B and C. These patterns should start to look familiar to you. In line four, I import the ArcPy site package and then in line five, I set up a variable to represent the city on which I want to query for park and rides. I'm going to be doing an attribute query for this city and then I'm going to follow it up with a spatial query to just get the park and rides that fall within that selected city. And putting line five at the top like this allows me to change the city so I can test with different values without hunting through my code and finding where that is. In line six, I set up the workspace, which is going to be my file geodatabase. This was a technique that I used also in exercise C solution, which is convenient because I'll be working with several feature classes here. In line seven and eight, I decided to go ahead here and set up some variables that represent the names of those feature classes. This is not necessary. I could just plug in these strings into the functions in lines 14 and 15. But sometimes when I'm working with a lot of data sets, I like to set up everything at the beginning just so I can see exactly what I'm working with. And so this is optional. The rest of the code, some of it could go within try except in finally blocks for simplicity. I've left those out here, although for code quality, you're asked to include those in appropriate places in your project submissions. What I'll do first here is go ahead in line 11 and set up the SQL query string to get just the city of Federal Way on its own. So I'm doing this attribute query here similar to what was done in exercise B. I'm querying on the name field for the city. The field name needs to go in double quotes in this string. So I'm enclosing the first part of the string in single quotes. The name of the city has to go within single quotes in the query. So I have to do a little bit of string concatenation here and enclose each of those single quotes in double quotes and stick everything together so I have that full query string. And once I have it in line 14, I can make a feature layer of just that target city. This will get just the city of Federal Way. And by now this pattern of making the feature layer and passing in the parameters should be familiar to you. The first parameter is the name of the feature class that I'm using. Remember in line 8, I set up a variable for that. The second parameter is the name I want to give this feature layer throughout this script. I'm going to call it city's layer. And then the third parameter is the optional SQL query expression and it's what will narrow down the cities to just be one city in this case. In line 15, I'm going to make a feature layer of all the park and ride facilities. And in line 15, I only pass in two parameters because I want all of the park and ride. So I'm not going to pass in any type of query string here. So the two parameters are the variable I set up in line 7 that gets the park and ride feature class. And then the name I want to give to this feature layer in this script which I just called it park and ride layer. With all of those elements, I can now do a select layer by location so that I can get just the park and rides that fall within the selected city. So I pass in the park and ride layer and the type of spatial relationship which I'm using which is contained by which you've seen in previous practice exercises. And then I'm working with the city's layer to do the selection. So that's the third parameter. Once I had that selection made, then I can copy those selected features into a new feature class. And just like you saw in practice exercise C, I'm using the copy features tool and I give it my park and ride feature layer. And then the second parameter here is the name of the new feature class that will be created. It's going to go into that workspace which is the Washington file geodatabase and I'm going to call that feature class target park and ride facilities. Now at the end of your code, probably within a finally block or somewhere at the end, you're going to delete the feature layers to clean them up. And in this case, we have two feature layers to clean up. And that's all it takes to complete this exercise.