We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71f5b39 commit 875e693Copy full SHA for 875e693
Week05/emails_ensar_bastopcu.py
@@ -0,0 +1,22 @@
1
+class Emails(list):
2
+ def __init__(self, emails):
3
+ self.validate(emails)
4
+ unique_emails = []
5
+ for email in emails:
6
+ if email not in unique_emails:
7
+ unique_emails.append(email)
8
+ super().__init__(unique_emails)
9
+ self.data = self
10
+
11
+ def validate(self, emails):
12
13
+ if not isinstance(email, str):
14
+ raise ValueError
15
+ if "@" not in email or "." not in email:
16
17
18
+ def __repr__(self):
19
+ return f"Emails({super().__repr__()})"
20
21
+ def __str__(self):
22
+ return super().__str__()
0 commit comments