hey guys I need you help, I'm new comer in here but I hope this can help me.
I'm writing a code that can read the file (such a story or newspaper) then the identifythe story if that story has a itemY in it the it will print +1 otherwise -1, but it always the other way around i got...here I always get -1 even the story has "lol"
hope you gus can help me
here the code below so far
def my_f(modelfilename):
modelfile = open(modelfilename)
modelline = modelfile.readline()
itemY = ["lol", "young", "HoLa", "...", "Yum!", ":o)", "blokes", "!!!", "hello"]
itemO = ["old", "yes", "Mom", "serious", "blog"]
while len(modelline) > 0:
a = modelline.split()
if itemY in a:
print "+1 young"
else:
print "-1 old"
return a
print my_f('1032824.female.15.Student.Libra.xml')
thnx heaps