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')