Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Noam ossia's challenge HW #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Python-Home-Challenges/NoamChallenge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

def most_frequent(List):
dict = {}
count, itm = 0, ''
for item in reversed(List):
dict[item] = dict.get(item, 0) + 1
if dict[item] >= count :
count, itm = dict[item], item
return(itm)

file = open('sample.txt','r')
data = file.read().replace('\n', '')
words = data.split()

print(f"The most occuring word is: {most_frequent(words)}")
1 change: 1 addition & 0 deletions Python-Home-Challenges/sample.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
I would love to try or hear the sample audio your app can produce. I do not want to purchase, because I've purchased so many apps that say they do something and do not deliver. Can you please add audio samples with text you've converted? I'd love to see the end results.Thanks!sfsdfasf