s = "Stackoverflow is a platform"
L = s.split(' ')
K = [' '.join(L[0:i]) for i in range(1,len(L)+1)]
print(K)
solved save all word permutations that are in a sentence in to a list [closed]
s = "Stackoverflow is a platform"
L = s.split(' ')
K = [' '.join(L[0:i]) for i in range(1,len(L)+1)]
print(K)
solved save all word permutations that are in a sentence in to a list [closed]