Question: PROBLEM 2: Looking for a secret Function Name: secret Parameters: secretFiles a list of strings; each string is a top secret filename Return value: None

PROBLEM 2: Looking for a secret Function Name: secret

Parameters: secretFiles a list of strings; each string is a top secret filename

Return value: None

Description: Plankton has had enough time suffering in the shadow of Mr. Krabs. It's time to get him what he wants: the secret Krabby Patty formula! Unfortunately, the formula is secret, so we don't know it. But we can help him out by looking for potential secrets in these files. Make a function that takes in a list of filenames and checks to see if "secret" is in each file. Check for any capitalization of secret. Then, make a file called "plankton.txt" listing your findings in the format shown in the test cases.

Note: Nothing is printed. The test cases show what certain files should contain after the function runs.

Test Cases: >>> secret(["Chapter01.txt", "Chapter02.txt", "Chapter03.txt", "Chapter04.txt", "Chapter05.txt", "Chapter06.txt", "Chapter07.txt", "Chapter08.txt"])

plankton.txt contains:

Chapter01.txt doesn't contain a secret. Don't bother.

Chapter02.txt doesn't contain a secret. Don't bother.

Chapter03.txt doesn't contain a secret. Don't bother.

Chapter04.txt doesn't contain a secret. Don't bother.

Chapter05.txt doesn't contain a secret. Don't bother.

Chapter06.txt doesn't contain a secret. Don't bother.

Chapter07.txt doesn't contain a secret. Don't bother.

Chapter08.txt doesn't contain a secret. Don't bother.

>>> secret(["Full_Novel.txt", "Prologue.txt"])

plankton.txt contains:

Full_Novel.txt contains a secret. Look into it! Prologue.txt doesn't contain a secret. Don't bother.

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!