In this program, we will take a string as input and find all substring frequencies in a string.
Steps to solve the program
- Take a string as input and create an empty list.
- Using for loop with range() function find all the possible substring combinations from the given string and add them to the empty list.
- Create an empty dictionary.
- Use for loop to iterate over each combination of the substring from the list.
- Add the combination as the key and its occurrences in the list as its value in the dictionary.
- Print the output.
Output :