I created a small function.
Problem is, It returns 0 where I expect something else.
I checked and checked and also modified the code few times, but I don’t see the buck.
Now I am not sure if it’s me or the code ;)
if you want a more elegant solution,
you can also do it like this.
task = list('2=6+8X')
# returning the position of 'x'
for i in range(len(task)):
if task[i] in ['x', 'X']: