Answer:
See explaination
Step-by-step explanation:
# Import required the module.
import random
# Define a function selector() which accepts the
# input_list, check_list, and return_list and
# returns a string named output.
def selector(input_list,check_list,return_list):
# Assign None to string variable output.
output=None
# Use for loop to traverse through input_list.
for i in range(len(input_list)):
# Check if element of an input_list is present
# in check_list.
if input_list[i] in check_list:
# Assign a random value from return_list
# to output.
output=random.choice(return_list)
# break out of the loop if input_list
# element is present in check_list.
break
#
return output
# Use assert statement to test a condition.
# If the condition is true, then program continues to
# execute, otherwise raises an AssertionError.
assert callable(selector)
assert selector(['is','in','of'],['of'], ['Yes']) == 'Yes'
assert selector(['is','in'],['of'], ['Yes','No']) == None
# Display the output.
print(selector(['is','in','of'],['of'], ['Yes']))
print(selector(['is','in'],['of'], ['Yes','No']))