end of day 2 week 1
This commit is contained in:
15
week 1/day 2/exo4.py
Normal file
15
week 1/day 2/exo4.py
Normal file
@@ -0,0 +1,15 @@
|
||||
users = ["admin", "root1", "John_Doe", "Alice", "Bob42"]
|
||||
|
||||
badChar=False
|
||||
|
||||
for user in users:
|
||||
for ch in user:
|
||||
if ('a' <= ch <='z') or ('A' <= ch <='Z') or ch == ' ':
|
||||
badChar=False
|
||||
else:
|
||||
badChar=True
|
||||
break
|
||||
if badChar == False and len(user) <= 20:
|
||||
print(user + " is Valid")
|
||||
else:
|
||||
print(user + " Error contain special character, space or digit !")
|
||||
Reference in New Issue
Block a user