Facebook
From Scanty Crocodile, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 76
  1. lst_1 = ['111 222', '111 333', '111 333 222']
  2. lst_2 = ['111', '222']
  3.  
  4. for i in range(len(lst_1)):
  5.     for e in lst_2:
  6.         if e not in lst_1[i]:
  7.             del lst_1[i]
  8.             print(lst_1)