src/Engine.py
def search(search_term,item=5):
    """ method to search from the google and organize the output """
    try:
        paa=people_also_ask.get_related_questions(search_term,item)
        output=[]
        for i in paa:
            response=people_also_ask.get_answer(i)
            if response.get("has_answer")==True:
                res = dict((k, response[k]) for k in ['question','response','displayed_link','link','title'] if k in response)
                res1=urllib.parse.unquote(res.get("link"))
                res["link"]=res1
                output.append(res)
            else:
                pass
    except:
        output=[]
    return(output)
 method to search from the google and organize the output 
method to search from the google and organize the output
method to search from the google and organize the output
def search(search_term,item=5):
    try:
        paa=people_also_ask.get_related_questions(search_term,item)
        output=[]
        for i in paa:
            response=people_also_ask.get_answer(i)
            if response.get("has_answer")==True:
                res = dict((k, response[k]) for k in ['question','response','displayed_link','link','title'] if k in response)
                res1=urllib.parse.unquote(res.get("link"))
                res["link"]=res1
                output.append(res)
            else:
                pass
    except:
        output=[]
    return(output)
def search ( search_term , item = 5 ) : try : paa = people_also_ask . get_related_questions ( search_term , item ) output = [ ] for i in paa : response = people_also_ask . get_answer ( i ) if response . get ( "has_answer" ) == True : res = dict ( ( k , response [ k ] ) for k in [ 'question' , 'response' , 'displayed_link' , 'link' , 'title' ] if k in response ) res1 = urllib . parse . unquote ( res . get ( "link" ) ) res [ "link" ] = res1 output . append ( res ) else : pass except : output = [ ] return ( output )
method to search from the google and organize the output
method to search from the google and organize the output
""" method to search from the google and organize the output """
search_term
item