I'm trying to sort posts from craigslist, but encoding is getting in my way.
Here's the code
# -*- coding: utf-8 -*-
sort_list = ['position title: construction laborer position summary: assisting on construction site with cleanup and other general labor. previous construction experience is preferred. safety conscious is a must! essential duties and responsibilities ● general site cleanup','i\'m moving a small church organ about 3 miles from west linn to oregon city monday morning. i need to a service to move it. it is being moved from the first level in one house to a first level in another house. it\'s about the size of but definitely lighter than a smaller upright piano. i would need it movedand monday morning at about 9 a.m. please email me your quote thank you ','position title: cdl a driver position summary: local moving company looking for a class a cdl driver to operate a 53 ft tractor‐trailer. only candidates willing to assist with local and commercial moves will be considered. this is a local driving job, drivers are home every night. essential duties and responsibilities: ● safely navigate moving trucks between city and residential neighborhoods. ● steady year round work. ']
## List of stuff we don't want
list = ['CDL','Full Time','Part Time','Drivers','Salary','Background Check','Resume','valid drivers license','social security','career','Full-Time','part-time']
for content in sort_list:
content = content.lower()
for thing in list:
thing = thing.lower()
if thing in content:
outcome = False
elif thing not in content:
outcome = True
print "\n\n",outcome,"\n\n",content
They all come out as True. They obviously shouldn't. Only two should be True.
Edit: Just had a realization that it may be the way I'm handling the loop. How do I do this with the outcome that I want?