Completed 5-10 Checking Usernames
This commit is contained in:
parent
255bdaf13c
commit
52e22103bc
20
Chapter_05/5-10_checking_usernames.py
Normal file
20
Chapter_05/5-10_checking_usernames.py
Normal file
@ -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')
|
||||||
Loading…
x
Reference in New Issue
Block a user