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
Get step-by-step solutions from verified subject matter experts
