First of all, I would like to apologize for my english since it is not my native language.
I'm having a quite crazy problem with the following code:
linecounter = []
for i in range(20):
linecounter.append("Color "+str(i)+"\n")
for line in linecounter:
color_list = range(20)
for j in range(len(color_list)):
stri = "Color " + str(j+1)
if stri in line:
print j
The result I expect: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
The result I'm getting: 0 1 2 3 4 5 6 7 8 0 9 0 10 0 11 0 12 0 13 0 14 0 15 0 16 0 17 0 18
Can somebody tell me how I get this result or how I get the result I want?
I would like to thank everyone who answers.
Sincerely, Nikster