Question
Write code that takes a string and a list of substrings, each with a length of three. Please use TWO WHILE LOOPS to solve this
Write code that takes a string and a list of substrings, each with a length of three. Please use TWO WHILE LOOPS to solve this problem, and NOT a "for" loop,or just one while loop. 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().
Here is the link to my code so far in the python visualizer, please modify it such that it meets the conditions above. https://goo.gl/dsN73z
Here is the error message I'm getting so far in command prompt for my code, if it helps you put things into perspective in regards to the test cases (which are below)
And finally, here are the test cases that the code MUST pass! inside happybirthday ['app'] True inside happybirthday ['pap'] False inside gggghhkkutdddflljjjjlkhhgdredh ['ggk','jjl'] True inside gggghhkkutdddflljjjjlkhhgdredh ['ggk','jjh'] False inside gggghhkkutdddflljjjjlkhhgdredh ['ggk','jjh','dfl'] True inside gggghhkkutdddflljjjjlkhhgdredh ['ggk','ddd'] True |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started