# Write a Python program to All substrings Frequency in String # Python3 code to demonstrate working of # All substrings Frequency in String# Using loop + list comprehension  # initializing stringtest_str = "abababa"  # printing original stringprint("The original string is : " + str(test_str))  # list comprehension to extract substringstemp = [test_str[idx: j] for idx in range(len(test_str))       for j in range(idx + 1, len(test_str) + 1)]  # loop to extract final result of frequenciesres = {}for idx in temp:     if idx not in res.keys():             res[idx] = 1     else:             res[idx] += 1               # printing result print("Extracted frequency dictionary : " + str(res)) 