From 52e22103bc494f28ccf28d62873620b86e399acb Mon Sep 17 00:00:00 2001 From: cheeks <134818917+leftovertoast@users.noreply.github.com> Date: Sun, 26 Jan 2025 13:30:21 -0500 Subject: [PATCH] Completed 5-10 Checking Usernames --- Chapter_05/5-10_checking_usernames.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Chapter_05/5-10_checking_usernames.py diff --git a/Chapter_05/5-10_checking_usernames.py b/Chapter_05/5-10_checking_usernames.py new file mode 100644 index 0000000..43fbf56 --- /dev/null +++ b/Chapter_05/5-10_checking_usernames.py @@ -0,0 +1,20 @@ +# Exercise 5-10 Checking Usernames +# Learning Objective: Create list and verify uniqueness of each entry. + +currentUsers = ['Tex', 'Spert', 'klumps20', 'porridgeboi', 'tonythetiger'] +#print(currentUsers) + +lowerCurrentUsers = [] + +for user in currentUsers: + lowerCurrentUsers.append(user.lower()) + +#print(lowerCurrentUsers) + +newUsers = ['randobob', 'stoopidpeet', 'tex', 'porridgeboi', 'calebrini'] + +for user in newUsers: + if user in lowerCurrentUsers: + print(f"Sorry, {user} is taken, please try another username.\n") + else: + print(f'The username {user} is available.\n')