Hi,
Var1 is a list and I'd like to strip characters from each item in the list and save the result as a new list called Var2. I can't find a way to do it. The code below seemed to be the logical solution but it doesn't work. What am I missing here? Thanks.
Var1 is a list and I'd like to strip characters from each item in the list and save the result as a new list called Var2. I can't find a way to do it. The code below seemed to be the logical solution but it doesn't work. What am I missing here? Thanks.
for item in Var1: Var2 = item.strip('1234 :') print(Var2)
Output:['1234 :A']
['1234 :B']
['1234 :C']