Python Forum

Full Version: converting the items of a list in new lists
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good morning friends,
I have the list1 (in a simplified way) that I need to convert to the list2. I can't find the way.
Could you help me, please?

list1 = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']


list2 = [[Monday],[Tuesday],[Wednesday],[Thursday],[Friday],[Saturday],[Sunday]]
list2 = [[weekday] for weekday in list1]
It seems so easy this way...
Thank you very much!!