Aug-30-2017, 07:08 AM
I am stuck on my code,
that's why I coming here because a lot of python master that solve my question...
thank you in advance
that's why I coming here because a lot of python master that solve my question...
a = "1,2,3" ax = a.split(",") jo = [] for b in ax: if b == "1": c = "a" elif b == "2": c = "b" elif b == "3": c = "c" jo.append(c) print(jo)and what i get is,
Output:['a']
['a', 'b']
['a', 'b', 'c']
but, the only one output that i want isOutput:['a', 'b', 'c']
how to fix it?thank you in advance