--want to know how I am meant to approach it.
Hmmm. This is aimed at an 8 year old. Not many 8 year-olds can churn out Python programs. Let's try something a little simpler.
The first step is to get a feel for things. What happens if we add up all the numbers 1+2+...+7? We get 28, which is too small. How do we get a bigger number? Subtracting or dividing will just make it smaller. So we have to multiply. We need it about 4 times bigger (3 x 28 = 84, 4 x 28 = 112). Well that is a bit misleading because the 4 will not be multiplying itself, it is more like 4*24. But let's get on and try 4.
There are two obvious ways of getting multiplication by 4. The first is (1+2+3) 4+5+6+7=42 - too small. [Bother cannot figure out how to turn off the italics!] The other is (1+2+3)+4(5+6+7) = 78. Still too small. So this is slightly trickier than it looks.
If we go to 5*(6+7) it will be too big.
Pause. 6*7=42. And (3*4*5)=60. So that would get us close. To 102 in fact. Could we get the -2 from the 1,2,3? That bit I leave to you.
But you may still complain that I pulled 6*7 and 3*4*5 out of thin air. Well, not completely. My thought process was as follows:
I need something bigger. 6*7=42. Oh, but then 3*4*5=60.
That does not look like a particularly logical progression. It isn't logical, but it is natural. 6,7 just shrieks 42. That is hardwired into my brain. 3,4,5 certainly whispers 60, maybe even speaks it.
There are for me two lessons from this. (1) you need to rote learn things. No progress is possible until your brain is stocked with useful facts. They have to be in your brain. Because you need really fast retrieval. If you have to mess around working out 6*7=42, it is much harder. (2) You need some organised playing around. By far the best books on that are the old Polya ones. An 8 year old could probably cope with his short book.