15 lines
436 B
Python
15 lines
436 B
Python
# Exercise 5-9 No Users
|
|
# Learning Objective: Expand 5-8 program Hello Admin to ensure list isn't empty.
|
|
|
|
users = ['tex', 'spert', 'klumps20', 'porridgeboi', 'admin']
|
|
|
|
#users = [] #test empty list
|
|
|
|
if users:
|
|
for user in users:
|
|
if user == 'admin':
|
|
print(f'Hello {user.title()}, would you like to see a report?')
|
|
else:
|
|
print(f'Hello {user.title()}, thank you for logging in again.')
|
|
else:
|
|
print('We need to find some users!') |