Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago