Skip to content

Commit feb3519

Browse files
authored
Update code.py
1 parent 8901abc commit feb3519

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# We will be using the search() function from the googlesearch module.
22
from googlesearch import search
33

4-
query = input("Enter your query : ")
5-
# This is the text that you want to search for.
6-
7-
for item in search(query, tld = "co.in", num=10, stop = 10, pause = 2):
8-
print(item)
4+
def query_finder(query):
5+
for item in search(query, tld = "co.in", num=10, stop = 10, pause = 2):
6+
print(item)
7+
8+
if __name__ == "__main__":
9+
query = input("Enter your query : ") # This is the text that you want to search for.
10+
query_finder(query)
11+
12+

0 commit comments

Comments
 (0)