diff --git a/Chapter_05/5-09_no_users.py b/Chapter_05/5-09_no_users.py new file mode 100644 index 0000000..61adbde --- /dev/null +++ b/Chapter_05/5-09_no_users.py @@ -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!') \ No newline at end of file