-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
31 lines (27 loc) · 900 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def text_queries(sentences, queries):
# Write your code here
for i in range(len(sentences)):
sentences[i] = sentences[i].split()
for i in range(len(queries)):
queries[i] = queries[i].split()
output = []
for i, x in enumerate(sentences):
print("Current Sentence:", x)
for query in queries:
print("Current Query:", query)
temp = []
match = True
for word in query:
print("Current Word:", word)
if word not in x:
print(word, "not in ", x)
match = False
break
if match == True:
print(query, "matches:", x)
print(i)
temp.append(i)
if temp:
output.append(temp)
for x in output:
print (x)