muhammad_nasif

TASK_11

Apr 16th, 2021
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.47 KB | None | 0 0
  1. def rem_duplicate(tpl):
  2.     lst = list(tpl)
  3.     newList = []
  4.     push = True
  5.     currentPosition = 0
  6.     for data_1 in lst:
  7.         push = True
  8.         for data_2 in newList:
  9.             if data_2 == data_1:
  10.                 push = False
  11.                 break
  12.  
  13.         if push == True:
  14.             newList.append(data_1)
  15.     tpl = tuple(newList)
  16.     return tpl
  17.  
  18.  
  19. lst = (1, 1, 1, 2, 3, 4, 5, [7, 7, 7, 5], [7, 7, 8, 5], [7, 7, 7, 5])
  20. print(rem_duplicate(lst))
  21.  
Advertisement
Add Comment
Please, Sign In to add comment