Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = {}
- word = input("Write your phrase: ")
- word = word.lower()
- word = word.replace(".", " ").replace(",", " ")
- for sentence in word.split(" "):
- if sentence != "":
- if sentence in count:
- count[sentence] += 1
- else:
- count[sentence] = 1
- else:
- pass
- for sentence in word.split():
- print(sentence, ':', count[sentence])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement