When Anton finished reading "War and Peace", he decided to find out the number of specific words used in the book. Help Anton write a simplified version of such a program that will be capable of counting the words separated by spaces and print the statistics.
The code should:
Prompt the user to input a sentence.
Count the occurrence of each unique word in the sentence.
Print the results, showing each word and its frequency.
Additional details:
Treat the input as case-insensitive (e.g., "The" and "the" should be counted as the same word).
Words are assumed to be separated by spaces.
Each word should be printed only once in the output, regardless of its frequency.
The output format for each word should be:
word frequency(e.g.,sun 3).The order of words in the output doesn't matter.