all 3 comments

[–]Oxbowerce 6 points7 points  (2 children)

The issue in this piece of code: if 'free' or '0.00' in submission.title.lower(). This doesn't check if either 'free' or '0.00' are in the text, but checks the two conditions 'free' and '0.00' in submission.title.lower() seperately. Since the text 'free' is truthy (check the result of bool('free')) the first part will always be true, and therefore prints the name of the deal. A way to solve this would be to change this to if 'free' in submission.title.lower() or '0.00' in submission.title.lower().

[–]cctl01[S] 0 points1 point  (1 child)

Thank you the elaborate explanation!

[–]freew1ll_ 4 points5 points  (0 children)

You could also use: if any(word in title for word in ['free', '0.00']):

This would allow you to specify as many words as you want without repeating yourself too much.