Maybe you didn't find the actual answers. I found the answer (in code) to the exercise you quoted here: https://www.wolfram.com/language/elementary-introduction/3rd-ed/answers-to-exercises.html
I'm not sure why you didn't find that. It's labeled "Answers to Exercises" in the table of contents.
Do you have access to Mathematica? I cannot imagine learning a computer language without access to a computer system in which I can test and repeat with variations the things I am being taught.
If you do have access, then you must have executed the examples in the text. The first few of the exercises you couldn't understand ask you to build on the text. They ask you to do one with a number like 4 instead of 10. Naturally, you tried to see what happens when you use 4 instead of 10 in the example code, and find it works. Some of the problems have a different number instead of 10, which suggests a different number should put in the code.
If you do not know what functions are, you will find learning computer programming hard, whatever language you study. It may be difficult even if you have only a weak understanding of them from precalculus. The text shows some examples where the output of one function becomes the input of another. The one exercise you cited as an example assumes you understood this and can figure out how to put the output of RandomInteger
into Range
(or vice versa, whichever way you find that it works). If you don't know enough math to understand how composition works, then this problem probably feels bewildering. You may need to learn more math. The problem also spirals back to the previous lesson and asks you to recall (or relearn) how RandomInteger
works.
If you do not have access to Mathematica, then — good news! — there's a link to WolframCloud in the online text, where you get a live notebook with the exercises and an input cell you can use to try out your code. It will check your output, too. Just click the "Check your answers in the Wolfram Cloud" button on the right side of the Exercises header. (At least I assume everybody can use it; I have an account, so I can't be sure.)
I always felt that if I had to look up the answer before I figured it out, then I hadn't really learned what I should have learned. Of course, sometimes when I checked my answer, I found out that was still true. One of the things that made learning Mathematica a bit easier for me, was that I could quickly execute my attempts. You can see if you're right on your own. And if it worked, it was easy to make a small change and see if the result was what I imagined would happen. A machine that would check my work was at my finger tips. That generally was not the case in my school courses.