Advertisement
malixds_

Untitled

Mar 21st, 2023
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. def main(lst):
  2.     new_lst = lst[:]
  3.     for j in range(len(new_lst)):
  4.         tmp = []
  5.         for i in new_lst[j]:
  6.             if i in tmp:
  7.                 continue
  8.             elif i not in tmp and i is not None:
  9.                 a = i
  10.                 a = a.replace('[at]', '@')
  11.                 a = a.replace('Нет', 'N')
  12.                 a = a.replace('Да', 'Y')
  13.                 if a.replace('.', '').isdigit():
  14.                     a = float(a)
  15.                     a = "{:.4f}".format(a)
  16.                 if a not in tmp:
  17.                     tmp.append(a)
  18.         new_lst[j] = tmp
  19.     tmp = []
  20.     for i in range(len(new_lst)):
  21.         if new_lst[i] in tmp:
  22.             continue
  23.         else:
  24.             tmp.append(new_lst[i])
  25.     return tmp
  26.  
  27.  
  28. print(main([['Нет', None, None, 'kifin32[at]rambler.ru', '0.6', '0.6'],
  29.             ['Да', None, None, 'zozorli58[at]gmail.com', '0.3', '0.3'],
  30.             ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2'],
  31.             ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2'],
  32.             ['Нет', None, None, 'sototij87[at]yahoo.com', '0.2', '0.2']]))
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement