I am trying to write a function to do the following:
Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string called text.
If it is found, return boolean True otherwise False.
Output the result of calling the function with the value in text.
This is what I have:
def isRed(text):
if text.find(red):
return (True)
else:
return (False)
return red
I get this error:
Program Failed for Input: ""
Expected Output: False
Your Program Output:
I'm new to functions, and a bit confused as to why this isn't working.