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)

 Write code that takes a string and a list of substrings,

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 

Command Prompt C:Users\swetha\Documents\CS-112\Assessment-5\Version-7>python driver5_v7 sample.py or input inside happybirthday ['app'], we expected True', but you got 'False assed test passed test For input inside geeghhkkutdddfl1jjjjlkhhgdredh ['egk', 'jjh'], we expected 'False' but you got 'True passed test passed test At least one test case did not pass yet % Total % Received %Xferd Average Speed Time Time 100 102 100 102 C:Users\ swetha\Documents\cS-112 Assessment-5\Version-7> Time Current Dload Upload Total Spent Left Speed 653 --:--: :--:...-:--:-- 6553

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!