New programmer needs help putting a list through a function or for loop

Welcome.

If you can recognise when you’ve finished, then maybe the break statement is what you need? It’s the way to leave a loop early.

Or if I’ve misunderstood, post a simple code example, and we’ll know what you’re talking about. When you post code, be sure to follow this advice.

1 Like