I use python 2.7.12 on Ubuntu 16.04, I have this in some part of my code:
for i in np.arange(0,max+1):
...
if i != 1 and i != max :
t_try[i] = (C_[i])/(2.0*D)
but I get different results with this changes:
for i in np.arange(0,max+1):
...
if (i != 1) and (i != max) :
t_try[i] = (C_[i])/(2.0*D)
or
for i in np.arange(0,max+1):
...
if (i != 1 and i != max) :
t_try[i] = (C_[i])/(2.0*D)
I failed to see what is the problem.
update: please note I'm not talking about "Boolean operators" and "Bitwise operators" accepted answer is @fernand 's answer, BTW thanks for you valuable time