 Hey, how's it going everybody? My name is John Hammond wanted to crank out the solution for you for the most recent challenge Real simple how many people and dogs are at the show if there are 22 heads and 72 feet total? Well, let's crank through this. It's pretty simple if we think it through for one thing if we have just people and Dogs that we're working with we also want to know there are a total of 22 heads, right? And there are a total of 72 feet well a person only has one head and they happen to have two feet a Dog only has one head and they happen to have four feet, right? Knowing this we can kind of set up equations for the total number of heads Since we know it's just both the people and dogs are taking like part they're as Part of it. They're factoring in and the same thing for feet So if we had a heads for that equation, it's pretty much like the coefficients there one plus Number of people plus one times the number of dogs It's going to give us 22 heads, right? So it's like the number of people plus a number of dogs Essentially x and y variables. That's all it is and Since we have these two equations and these two variables It's pretty much. This is simple System of equations same thing works for feet people Two plus people two times people since people have two feet four times dogs since a dog will have four feet as we call 72 So all we have to do is have Python solve this these systems of equations for us We can do that with the SimPy module Go ahead and import SimPy and let's create these symbols for us. Let's say people and dogs equals SimPy dot symbols People and dogs and now we can just print out the result of Solving that equation SimPy dot solve SimPy dot eq So we want people plus dogs that equal 22 regards to heads and we have another equation In regards to feet. Oh We had two feet for each person and we had four feet for each dog and that were that was 72 total feet and Since we are solving multiple equations will actually have to throw these in an array or in a list So just wrap those in braces and then we're solving for people and dogs Now when you run this hey, we get our solution. We had eight people and we had 14 dogs Okay, easy enough that solves it for us in my book that I'm grabbing all of these logic puzzles from that is the correct answer There were eight people and 14 dogs at the show. We just solved that really simply setting up a Setting up two equations. So really a simple system of equations and then having Python solve that with the SimPy module Easy enough. Thanks for watching guys. Hope you enjoyed this. Hope the code that you sent in is pretty similar See you in a new video