Skip to content

Word frequency #2240

@Yeswanth-Chippada

Description

@Yeswanth-Chippada

def word_count(str):
counts = dict()
words = str.split()

for word in words:
    if word in counts:
        counts[word] += 1
    else:
        counts[word] = 1

return counts

print( word_count('the quick brown fox jumps over the lazy dog.'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions