I'm a newbie in python. Basically what I wanted to achieve is:
I have a block of sample data as shown here:
384&cp54,cp170,cp285,cp401,cp517,cp633,cp748,cp864,cp980,cp1096,cp1205,cp1315,cp1424,cp1534,cp1643,cp1753,cp1862,cp1972,cp2082,cp2191,cp2301,cp2410,cp2520,cp2630,cp2739,cp2849,cp2958,cp3068,cp3178,cp3287,cp3342,cp3397,cp3451,cp3506,cp3561,cp3616,cp3671,cp3725,cp3780,cp3835&hp21,hp37,hp49,hp58,hp66,hp73,hp79,hp85,hp91,hp96,hp101,hp105,hp109,hp113,hp117,hp121,hp125,hp129,hp132,hp136,hp139,hp142,hp146,hp149,hp152,hp155,hp158,hp161,hp164,hp166,hp168-170,hp172-174,hp176-178,hp180
How do I code using python3 to achieve the following without having to manually to add the " " sign for each item after the comma.
The desired outcome:
datalist = list()
print(datalist)
Results:
['stritem1','stritem2','stritem3','stritem4'....etc]