Coroutines
import time def searcher (): book = "Hello,I Am Ashish Dinesh Patil And Welcome To Python Programming" print ( "Reading Book" ) time.sleep( 4 ) while True : text = ( yield ) if text in book: print ( "Your Text is in the Book" ) else : print ( "Your Text is not in the Book" ) search = searcher() next (search) search.send( "Ashish" ) input ( "Press Any Key" ) search.send( "Ashish Dinesh Patil" )