end of day 2 week 1

This commit is contained in:
2026-01-21 11:27:18 +01:00
parent 2fed48e17f
commit b1c74929ac
4 changed files with 102 additions and 0 deletions

15
week 1/day 2/exo4.py Normal file
View 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 !")