Add 'Informatics/InfLab3/' from commit '7e065b45b7cf20a1fc712723ec31119e8c9f9ac6'

git-subtree-dir: Informatics/InfLab3
git-subtree-mainline: 3c886c1b43
git-subtree-split: 7e065b45b7
This commit is contained in:
LeterZP
2026-02-13 19:42:47 +03:00
3 changed files with 111 additions and 0 deletions
@@ -0,0 +1,34 @@
# Author = Bosenko Boris Igorevich
# Group = P3115
# Date = 12.11.2025
import re
def mail(email):
if re.fullmatch(r'[\w.]*@[a-zA-Zа-яА-я]+(\.[a-zA-Zа-яА-я]+)+', email):
return email[email.index("@") + 1:]
else:
return "Fail!"
if __name__ == "__main__":
try:
tests = [
"day@dfgdfg..",
"ind_out.us@out_because.us",
"2let@it.be.me",
"no_here.there@and.there",
"1322list@another8916.21"
]
for test in tests:
print(mail(test), end=" ")
print()
results = [
"not.here",
"Fail!",
"it.be.me",
"and.there",
"Fail!"
]
print(*results, sep=" ")
except Exception as error:
print(f"Ошибка: {error}")