Michael A
0
Q:

Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string. If it is found, return boolean True otherwise False. Finally output the result of calling the function with the value in text.

Write a function isRed() that accepts a string parameter and looks for the presence of the word ‘red’ in the string.
If it is found, return boolean True otherwise False.
Finally output the result of calling the function with the value in text.
def isRed(redexistance):
  output = redexistance.find('red')
  if output < 0:
    return 'False'
  else:
    return 'True'
print(isRed(text))
0

New to Communities?

Join the community