输入应该是手动的,并且必须能够计算任何类型的输入的子字符串数并显示它们
ask by Sanjana Ravichandran translate from so# Function to print all sub strings
def subString(s, n):
# Pick starting point in outer loop
# and lengths of different strings for
# a given starting point
c=0
str=[]
for i in range(n):
for len in range(i+1,n+1):
str.append(s[i: len]);
c+=1
print("Number of substrings:",c)
print("Substrings are :",", ".join(str))#prints substring
# Driver program to test above function
s = "abcd";
subString(s,len(s));