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

HW4RonBiton #4

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
11 changes: 11 additions & 0 deletions HW4RonBitonPFNEW.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


file_song =open("song.txt","r")
data=file_song.read().split()
dict = {}
for i in data:
if i in dict:
dict[i] = dict[i] + 1
else:
dict[i] = 1
print(f'the word that appears most is: {max(dict, key=dict.get)}, And it appears {dict[max(dict, key=dict.get)]} times')
16 changes: 16 additions & 0 deletions song.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Well I heard there was a secret chord
That David played and it pleased the Lord
But you don't really care for music, do you?
Well it goes like this:
The fourth, the fifth, the minor fall and the major lift
The baffled king composing Hallelujah

Hallelujah, Hallelujah, Hallelujah, Hallelujah...

Well your faith was strong but you needed proof
You saw her bathing on the roof
Her beauty and the moonlight overthrew ya
She tied you toher kitchen chair
She broke your throne and she cut your hair
And from your lips she drew the Hallelujah