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
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