import urllib
import urllib.request
import json
url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&"
query = input("Query:")
query = urllib.parse.urlencode( {'q' : query } )
response = urllib.request.urlopen (url + query ).read()
print ("response is: ", response)


