0
listx = ['Day Mover ', 'Resurg Micro']

Is there a way to make all words lower case and remove all spaces in general code? I tried:

new_list = [elem for elem in listx if elem.strip()]

Expected output:

new_list = ['day_mover', 'resurg_micro']
 
jezrael
  • 822,522
  • 95
  • 1,334
  • 1,252
Arpp
  • 107
  • 5

0 Answers0