I have a input string like this:
pentavac-xim, revaxis, tetravac-xim
imovax polio, pediacel
act-hib, rage diploide
imogam rage pa, imovax polio
dt vax, tetavax
I want the Output string to displayed as:
['pentavac-xim', 'revaxis', 'tetravac-xim']
['imovax polio', 'pediacel']
['act-hib', 'rage diploide']
['imogam rage pa', 'imovax polio']
['dt vax', 'tetavax']
The problem is when I use split on the input string, for a product which should be treated as a single string, is converted into 2 separate strings, example:
imogam rage pa = ['imogam', 'rage', 'pa'] which is incorrect . It should be : ['imogam rage pa']. How to solve this
You could try something like:
input_string = 'pentavac-xim, revaxis, tetravac-xim'
output = input_string.split(', ')
print(output)
Outputs: ['pentavac-xim', ' revaxis', ' tetravac-xim']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With