def coroutine(text): while True: input_search = (yield) if input_search in text: print 'contained' else: print('no')