← Back to challenges

Find the Bomb

PythonMediumregexlanguage_fundamentalsstrings

Instructions

Create a function that finds the word "bomb" in the given string (not case sensitive). If found, return "Duck!!!", otherwise, return "There is no bomb, relax.".

Examples

bomb("There is a bomb.") ➞ "Duck!!!"

bomb("Hey, did you think there is a bomb?") ➞ "Duck!!!"

bomb("This goes boom!!!") ➞ "There is no bomb, relax."

Notes

"bomb" may appear in different cases (i.e. uppercase, lowercase, mixed).

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is the Water Boiling?