I tried having both an and and or in a single if statement but it didn't seem to work properly. I tried having the and both in front of and after the or (so if ... or ... and ... and also if ... and ... or ...), neither seemed to work correctly.
# entryIndex is an int that increases by one every time in a for loop
if entryIndex % 11 == 0 or entryIndex == 0 and entryValue == '':
# This should check if entryIndex == 0 or it has a remainder of 0 AND if entryValue is equal to ''
...
else:
...
So I had to separate it into 2 checks
if entryIndex % 11 == 0 or entryIndex == 0:
if entryValue == '':
...
else:
...
Aucun commentaire:
Enregistrer un commentaire