human
Check if given words are present in a string | Helper Function to the Finding bigString.
Initialize leftBigIdx and rightBigIdx and leftSmallIdx variables.
Iterate until leftBigIdx variable reaches less than or equal to rightBigIdx.
Check if bigString [ leftBigIdx ] is not equal to smallString [ leftSmallIdx ] or Check if bigString [ rightBigIdx ] is not equal to smallString [ rightSmallIdx ] than return false otherwise increment leftBigIdx and leftSmallIdx decrement rightBigIdx and rightSmallIdx.
Function to the bigString.
iterate in the bigString.
Check if length of smallString + i is greater than the length of bigString.
call the function isInBigStringHelper.
Function to the multiStringSearch.
iterate in the smallString.
calling the isInBigString Function.
Driver code.
initialize string.
initialize vector string.
Function call.
Print answers.
Check if ans [ i ] is equal to 1 then Print true otherwise print false"
How can the above be solved in Python?

Write me a code to check if given words are present in a string and the other steps required?
assistant
#Here is code to check if given words are present in a string and the other steps required.
 def isInBigStringHelper ( bigString , smallString , startIdx ) :
	leftBigIdx = startIdx
	rightBigIdx = startIdx + len ( smallString ) - 1
	leftSmallIdx = 0
	rightSmallIdx = len ( smallString ) - 1
	while ( leftBigIdx <= rightBigIdx ) :
		if ( bigString [ leftBigIdx ] != smallString [ leftSmallIdx ] or bigString [ rightBigIdx ] != smallString [ rightSmallIdx ] ) :
			return False
		leftBigIdx += 1
		rightBigIdx -= 1
		leftSmallIdx += 1
		rightSmallIdx -= 1
	return True
def isInBigString ( bigString , smallString ) :
	for i in range ( len ( bigString ) ) :
		if ( i + len ( smallString ) > len ( bigString ) ) :
			break
		if ( isInBigStringHelper ( bigString , smallString , i ) ) :
			return True
	return False
def multiStringSearch ( bigString , smallStrings ) :
	solution = [ ]
	for smallString in smallStrings :
		solution . append ( isInBigString ( bigString , smallString ) )
	return solution
if __name__ == ' _ _ main _ _ ' :
	str1 = " this ▁ is ▁ a ▁ big ▁ string "
	substr = [ " this " , " yo " , " is " , " a " , " bigger " , " string " , " kappa " ]
	ans = multiStringSearch ( str1 , substr )
	for i in range ( len ( ans ) ) :
		if ( ans [ i ] == 1 ) :
			print ( " true " , end = " ▁ " )
		else :
			print ( " false " , end = " ▁ " )