Skip to content
Open
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions Python-Home-Challenges/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
f = open("Challenge_01.txt", "r")
Comment thread
BarakMerdler marked this conversation as resolved.
Outdated
Comment thread
AviadP marked this conversation as resolved.
Outdated
data = f.read().split()
dict = {}
Comment thread
BarakMerdler marked this conversation as resolved.
Outdated
for word in data:
if word in dict:
dict[word] += 1
else:
dict[word] = 1
print(
f'Most recurring word in that file: {max(dict, key=dict.get)}, And it appears {dict[max(dict, key=dict.get)]} times')
Comment thread
AviadP marked this conversation as resolved.
Outdated