fork download
  1. import re
  2. str_1 = "& peers & & apples & & lemon juice & & Strawberries & & Mellon & "
  3. print( [x.strip() for x in str_1.split('&') if x.strip()] )
  4.  
  5.  
Success #stdin #stdout 0.03s 9372KB
stdin
Standard input is empty
stdout
['peers', 'apples', 'lemon juice', 'Strawberries', 'Mellon']