My Python code is not outputting anything?
<p>I'm currently trying to teach myself Python with the <em>Python Crash Course</em> book by Eric Matthes and I seem to be having difficulties with excercise 5-9 regarding using if tests to test empty lists.</p>

<p><strong>Here is the question:</strong></p>

<p>5-9. No Users: Add an if test to hello_admin.py to make sure the list of users is not empty. </p>

<p>â¢ If the list is empty, print the message We need to find some users!</p>

<p>â¢ Remove all of the usernames from your list, and make sure the correct message is printed.</p>

<p><strong>Here is my code from hello_admin.py:</strong></p>

<pre><code>usernames = ['admin', 'user_1', 'user_2', 'user_3', 'user_4']

for username in usernames:

    if username is 'admin':
        print("Hello admin, would you like to see a status report?")
    else:
        print("Hello " + username + ", thank you for logging in again.")
</code></pre>

<p><strong>Now here is my code for 5-9 which is not outputting anything:</strong></p>

<pre><code>usernames = []

for username in usernames:

    if username is 'admin':
        print("Hello admin, would you like to see a status report?")
    else:
        print("Hello " + username + ", thank you for logging in again.")
    if usernames:
        print("Hello " + username + ", thank you for logging in again.")
    else:
        print("We need to find some users!")
</code></pre>

<p>Does anyone having any feedback for why my code is not outputting: "We need to find some users!" Thank you for your time. :)</p>

<p>The first if-else should come inside the the for loop. The second if else block should come outside. </p>

<pre><code>usernames = []

for username in usernames:

    if username is 'admin':
        print("Hey admin")
    else:
        print("Hello " + username + ", thanks!")

if usernames:
    print("Hello " + username + ", thanks again.")
else:
    print("Find some users!")
</code></pre>

python