Skip to content Skip to sidebar Skip to footer

List To String To List Python 3

I need to convert a list into a string and then do the reverse process. Note that one script will convert List->String and another script will convert String->List, so store

Solution 1:

This should work:

str_l = ("|").join(l)

Which gives you your first string. Then do:

l_2 = str_l.split("|")

Which gives you your second list.

enter image description here

Post a Comment for "List To String To List Python 3"