Trying to convert a string in csv to list item
Here it is what I am trying:
txt = "east2,east3"
x = txt.split()
print(x)
Tried the below as well, still get same result:
txt = "east2,east3"
x = txt.split(", ")
print(x)
Output:
['east2,east3']
Expected:
['east2','east3']
csvmodule to load CSV file?csvlibrary should be usefulx = txt.split(", ")but still same resultlist(map(str.strip, txt.split(",")))txt.split(',')correct,txt.split(', ')incorrect in this context.