57.4k views
0 votes
Write a function named find_bigfoot which takes a string as an argument, and then determines whether the string "bigfoot' is found in the parameter. Then it returns true or false, depending on whether it was found or not. For example:

find_bigfoot("There is no yeti");
find_bigfoot("footbig not here");
would both return false, since the string bigfoot isn't part of the string while:
find_bigfoot("I believe in bigfoot");
find_bigfoot("bigfoot is around here");
would both return true, since the string bigfoot is part of the string.

1 Answer

6 votes

Final answer:

The function 'find_bigfoot' checks for the exact phrase 'bigfoot' within a given string and returns true or false accordingly. It is implemented here in Python using the 'in' keyword for simplicity.

Step-by-step explanation:

The find_bigfoot function can be written in several programming languages. Below is an example of how you might write this function in Python:

def find_bigfoot(s):
return "bigfoot" in s

This function simply checks if the substring "bigfoot" is in the string s passed as a parameter. It uses the in keyword, which looks for the exact sequence of letters in the provided string. If "bigfoot" is found, it returns true; otherwise, it returns false.

Example Usage

print(find_bigfoot("There is no yeti")) # Output: False
print(find_bigfoot("I believe in bigfoot")) # Output: True

This function is case-sensitive, meaning it will not recognize variations in casing like 'Bigfoot' or 'BIGFOOT' unless additional code is added to handle such cases.

User VonUbisch
by
8.2k points