I was iterating over a List and print each element, why the code throws error? : <p>I was iterating over a List and print each element, the code is very simply, but the program throws error.</p>

<p><a href="https://i.stack.imgur.com/Crjy0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Crjy0.png" alt="enter image description here"></a></p>
