Changing a variable outside of a for loop : <p>I am writing a program where I am accessing an object in a list using a for loop. I want to be able to change a variable outside of a for loop from within the loop. Code snippet below:</p>

<pre><code>member_found = False    # default value

for member in self._members:
    if member_id == member.get_account_ID():
        member_found = True
</code></pre>

<p>In PyCharm, I am getting a notification that says "Local variable 'member_found' value is not used." When I run this code, it doesn't seem to produce any errors, but I want to make sure the variable outside the for loop is actually being changed.</p>

<p>I can always make the default value an empty list and append the list, but I would rather use booleans if possible.</p>
