Question: in python would you please help me to keep this code as in a simple and easy code to follow please I want the code

in python would you please help me to keep this code as in a simple and easy code to follow please

I want the code to run like first line of the letters

['B', 'C', 'D', 'BC', 'CB', 'BD', 'BCB', 'CBD', 'BCBD'] 
['B', 'BC', 'BCB', 'BCBD', 'C', 'CB', 'CBD', 'BD', 'D']

word="BCBD" lst=[] for i in range(len(word)): for j in range(i+1,len(word)+1): if word [i:j] not in lst: lst.append(word[i:j]) print(lst)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!