Having trouble on solving the following tasks

You mean something like this

Yes. And, now it should be obvious that a for loop can be used to step through the first index.