You want to be able to break large code into chunks. This isn't a long piece of code, but they want to introduce you to functions. A big part of code is writing functions, but then you control when you call them and when they work with other functions as well. I hope this makes some sense. It's hard to see why functions are needed, but the more you study them, the more you'll realize that they're a big part of programming, especially if you're going to do it as a career.
There is nowhere in the lesson that says while loops should be nested in the function, pay attention to the function_name, it is very much relevant to what the loop is doing. It is just to give you a better understanding of the process that is happening.
So, now if you need to use your while loop many times you just need to call your function soloLoop(). Hope this help you.