Question: ```
file_str = input("Enter poem: ")
my_file = open(file_str, "r")
words = file_str.split(',' or ';')

```

I have a file on my computer that contains a really long poem, and I want to see if there are any words that are duplicated per line (hence it being split by punctuation).

I have that much, and I don't want to use a module or Counter, I would prefer to use loops. Any ideas?

Answer: 
```
with open (r"specify the path of the file") as f:
    data =  f.read()
    if(set([i for i in data if f.count(f)>1])):
        print "Duplicates found"
    else:
        print "None"

```
```
def Counter(text):
   d = {}
   for word in text.split():
       d[word]  = d.get(word,0) + 1
   return d

```

there is loops :/ 

to split on punctionation just us

```
matches = re.split("[!.?]",my_corpus)
for match in matches:
    print Counter(match)

```