21 lines
577 B
Python
21 lines
577 B
Python
# 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')
|