Python Problem 7 | Python Tutorials For Absolute Beginners In Hindi #115

Python Practice problem 7 (Medium, 20 points)

Search Engine

You are given few sentences as a list (Python list of sentences). Take a query string as an input from the user. You have to pull out the sentences matching this query inputted by the user in decreasing order of relevance after converting every word in the query and the sentence to lowercase. Most relevant sentence is the one with the maximum number of matching words with the query.

Sentences = [“This is good”, “python is good”, “python is not python snake”]

Input:

Please input your query string

“Python is”

Output:

3 results found:

1.      python is not python snake

2.      python is good

3.      This is good


►Full Python tutorials for absolute beginners (Hindi) playlist - https://www.youtube.com/playlist?list=PLu0W_9lII9agICnT8t4iYVSZ3eykIAOME
►Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww


Be the first person to comment!

Comments(0)