Completed 5-9 No Users
This commit is contained in:
parent
8f7a239516
commit
255bdaf13c
15
Chapter_05/5-09_no_users.py
Normal file
15
Chapter_05/5-09_no_users.py
Normal file
@ -0,0 +1,15 @@
|
||||
# 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!')
|
||||
Loading…
x
Reference in New Issue
Block a user