fork download
  1. a = [('misure', 'di', 'protezione'), ('libertà', 'di', 'espressione'), ('misure', 'di', 'protezione', 'libertà', 'di', 'espressione')]
  2.  
  3. try:
  4. b = [tuple(j for j in i if 'di' not in j) for i in a]
  5. print b
  6. except Exception as e:
  7. print e
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
[('misure', 'protezione'), ('libert\xc3\xa0', 'espressione'), ('misure', 'protezione', 'libert\xc3\xa0', 'espressione')]