Stephane MOHN Stephane MOHN - 4 months ago 9
Python Question

Python3: TypeError: 'NoneType' object is not subscriptable

On this line

...
print('1','0')['-'in y or(int(y)-int(x[z]))*d.find('I')<=0])]
...

Answer

if you're in python3 put your code in brackets

print( ('1','0')['-'in y or(int(y)-int(x[z]))*d.find('I')<=0])] )