Skip to content

Commit 953eaf3

Browse files
authored
Create Emails class for email validation and storage
Implement Emails class to manage a list of valid email addresses.
1 parent 71f5b39 commit 953eaf3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Week05/test_emails_yasin_soytas.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Emails(list):
2+
def __init__(self, emails=None):
3+
super().__init__()
4+
5+
if emails is None:
6+
return
7+
8+
for email in emails:
9+
if isinstance(email, str) and "@" in email:
10+
email = email.lower()
11+
if email not in self:
12+
self.append(email)

0 commit comments

Comments
 (0)