Course Hero Logo

programming assignment unit 7.txt -...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 out of 1 page.

alphabet='abcdefghijklmnopqrstuvwxyz'test_dups=['zzz','dog','subdermatoglyphic','subdermatoglyphics']test_miss=['zzz','subdermatoglyphic','the quick brown fox jumps over the lazy dog']def histogram(s):#(Downey, 2015)d=dict()for c in s:if c not in d:d[c]=1else:d[c]+=1return ddef has_duplicates(s):for p in histogram(s).values():if p>1:return Trueelse:return Falsedef test_dups_loop():for s in test_dups:if s.count('z')>1:print(s +': (has duplicates)',has_duplicates(s))
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
SHEBAH
Tags
The quick brown fox jumps over the lazy dog

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture