per1="25"
per2 = ".75"
if row[23] == 'sale1' or row[23] == 'sale2':
if row[27].find(per1) == -1:
cursor.execute(sql)
else:
cursor.execute(sql)
Or
per2 = ".75"
if row[23] == 'sale1' or row[23] == 'sale2':
if row[27].find(per2) == -1:
cursor.execute(sql)
else:
cursor.execute(sql)
If I do this, it'll be filtered properly
per1 = ".25"
per2 = ".75"
if row[23] == 'sale1' or row[23] == 'sale2':
if row[27].find(per1) == -1 and row[27].find(per2) == -1:
cursor.execute(sql)
else:
cursor.execute(sql)
In this case, it doesn't filter at all.
Why is that?
per1 = ".25"
per2 = ".75"
if row[23] == 'sale1' or row[23] == 'sale2':
if row[27].find(per1) == -1 or row[27].find(per2) == -1:
cursor.execute(sql)
else:
cursor.execute(sql)
Change "and" to "or".
© 2024 OneMinuteCode. All rights reserved.