С
Size: a a a
С
ER
ER
def email_gen(list_of_names):
'''emails = []
letter = 1
for i in list_of_names:
if i[1] + '.' + i[0][0:letter] + '@company.io' in emails:
letter += 1
emails.append(i[1] + '.' + i[0][0:letter] + '@company.io')
return emails
С
ER
ER
ER
б
б
ER
ER
б
б
ER
def email_gen(list_of_names):
emails = []
letter = 1
for i in list_of_names:
if i[1] + '.' + i[0][0:letter] + '@company.io' in emails:
letter += 1
emails.append(i[1] + '.' + i[0][0:letter] + '@company.io')
return emails
task_file = open('task_file.txt', 'r')
text = task_file.read().split('\n')
task_file.close()
text_person = []
[text_person.append(n.split(', ')) for n in text]
first_last_name = []
for j in range(1, len(text_person) - 1):
first_last_name.append((text_person[j][1] + '/' + text_person[j][2]).split('/'))
email = email_gen(first_last_name)
task_file_valid = open('task_file_valid.txt', 'w')
task_file_invalid = open('task_file_invalid.txt', 'w')
task_file_valid.write(text[0] + '\n')
task_file_invalid.write(text[0] + '\n')
for j in range(1, len(text) - 1):
if len(text_person[j][1]) != 0 \
and text_person[j][1].isalpha() \
and 'wf' not in text_person[j][1] \
and len(text_person[j][2]) != 0 \
and text_person[j][2].isalpha() \
and 'wf' not in text_person[j][2] \
and text_person[j][1] != text_person[j][2] \
and len(text_person[j][3]) == 7 \
and text_person[j][3].isdigit() \
and int(text_person[j][3]) != 0 \
and len(text_person[j][4]) != 0:
task_file_valid.write(email[j-1] + text[j] + '\n')
else:
task_file_invalid.write(text[j] + '\n')
task_file_valid.close()
task_file_invalid.close()
ER
б
A
def email_gen(list_of_names):
emails = []
letter = 1
for i in list_of_names:
if i[1] + '.' + i[0][0:letter] + '@company.io' in emails:
letter += 1
emails.append(i[1] + '.' + i[0][0:letter] + '@company.io')
return emails
task_file = open('task_file.txt', 'r')
text = task_file.read().split('\n')
task_file.close()
text_person = []
[text_person.append(n.split(', ')) for n in text]
first_last_name = []
for j in range(1, len(text_person) - 1):
first_last_name.append((text_person[j][1] + '/' + text_person[j][2]).split('/'))
email = email_gen(first_last_name)
task_file_valid = open('task_file_valid.txt', 'w')
task_file_invalid = open('task_file_invalid.txt', 'w')
task_file_valid.write(text[0] + '\n')
task_file_invalid.write(text[0] + '\n')
for j in range(1, len(text) - 1):
if len(text_person[j][1]) != 0 \
and text_person[j][1].isalpha() \
and 'wf' not in text_person[j][1] \
and len(text_person[j][2]) != 0 \
and text_person[j][2].isalpha() \
and 'wf' not in text_person[j][2] \
and text_person[j][1] != text_person[j][2] \
and len(text_person[j][3]) == 7 \
and text_person[j][3].isdigit() \
and int(text_person[j][3]) != 0 \
and len(text_person[j][4]) != 0:
task_file_valid.write(email[j-1] + text[j] + '\n')
else:
task_file_invalid.write(text[j] + '\n')
task_file_valid.close()
task_file_invalid.close()
ER