I can't modify

That has nothing to do with the number of iterations. It is the number of return values your function is returning. That probably means you copied a very old version of that notebook (pre-April 2021) and they have changed the definition of that function.

It is a bad idea to copy old code off the internet a) because it’s cheating and you don’t really learn anything and b) because it doesn’t work if the code is old.

I suggest you rename your notebook, get a clean copy and then start over. You may be able to salvage some of your previous “work”, but you need to be careful to respect the template code they give you. You can’t just “copy/paste” over the whole function without looking.