Hi

Okay so i have a text file and i have it converted to a bunch of lists with strings as the words. Now i need to find words that occur only once in the entire text file, how can i do this using a loop?
A hint says that i should make 2 lists, one should keep track of words appear once, and the other should have words that appear more than once. Also i can't use sets and dictionaries.

Any clues?

I've tried something like this:

wordsingle = []
worddouble = []
    for word in l:
        if word in l > 2:
            worddouble.append(word)
        else:
            wordsingle.append(word)
    return worddouble

But it doesn't work, im stuck here.

wordsingle = []
worddouble = []
for word in l:
    if word in wordsingle:
       worddouble.append(word)
    else:
       wordsingle.append(word)
    
return [ word for word in wordsingle if word not in worddouble]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.