Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main(lst):
- new_lst = lst[:]
- for j in range(len(new_lst)):
- tmp = []
- for i in new_lst[j]:
- if i in tmp:
- continue
- elif i not in tmp and i is not None:
- a = i
- a = a.replace('[at]', '@')
- a = a.replace('Нет', 'N')
- a = a.replace('Да', 'Y')
- if a.replace('.', '').isdigit():
- a = float(a)
- a = "{:.4f}".format(a)
- if a not in tmp:
- tmp.append(a)
- new_lst[j] = tmp
- tmp = []
- for i in range(len(new_lst)):
- if new_lst[i] in tmp:
- continue
- else:
- tmp.append(new_lst[i])
- return tmp
- print(main([['Нет', None, None, 'kifin32[at]rambler.ru', '0.6', '0.6'],
- ['Да', None, None, 'zozorli58[at]gmail.com', '0.3', '0.3'],
- ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2'],
- ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2'],
- ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2']]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement