Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using python and while loop only, Write code that takes a string and a list of substrings, each with a length of three. Return True

Using python and while loop only,

Write code that takes a string and a list of substrings, each with a length of three. Return True or False depending on whether the strings contains any of the substrings. For example, if the string was happybirthday, and the list of substrings was ['hay', 'pyr', 'bir', 'hdy'], your code would return True. Do not use the in keyword. You may not use any built-in functions/methods besides len() and .append().

Template:

def inside(string, list): string = string list = list #YOUR CODE GOES HERE (indented) return False #END YOUR CODE

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_2

Step: 3

blur-text-image_3

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

What is the elimination-by-aspects decision rule? Discuss.

Answered: 1 week ago