Question
Python Introduce AND and OR operators for at least 2 keywords, ok to limit to only 1 operator (either AND used or OR used, ok
Python
Introduce AND and OR operators for at least 2 keywords, ok to limit to only 1 operator (either AND used or OR used, ok if program doesn't work well for combination of both or for more than 2 keywords):
a search query "love AND flower" should return only results containing both "love" and "flower":
"If you love a flower that lives on a star, it is sweet to look at the sky at night. All the stars are a-bloom with flowers...", "Of course, I love you,' the flower said to him. 'If you were not aware of it, it was my fault." "If you love a flower that lives on a star, then it's good at night, to look up at the sky. All the stars are blossoming." optional (ok if it is returned or not): "If someone loves a flower of which just one exists among all the millions and millions of stars, that's enough to make him happy when he looks at the stars.",
a search query "love OR flower" should return results containing either "love" or "flower": optional (ok if it is returned or not): "You see, one loves the sunset when one is so sad." "If you love a flower that lives on a star, it is sweet to look at the sky at night. All the stars are a-bloom with flowers..." "Grown-ups love figures... When you tell them you've made a new friend they never ask you any questions about essential matters. They never say to you \"What does his voice sound like? What games does he love best? Does he collect butterflies? \" Instead they demand \"How old is he? How much does he weigh? How much money does his father make? \" Only from these figures do they think they have learned anything about him." "I was too young to know how to love her." optional (ok if it is returned or not):"I have always loved the desert. One sits down on a desert sand dune, sees nothing, hears nothing. Yet through the silence something throbs, and gleams..." "Of course, I love you,' the flower said to him. 'If you were not aware of it, it was my fault.", part E (submit as a separate program): Analyze the inputs and outputs from the program above, what happens if the user enters same keyword multiple times, ex: "flower AND flower", does your program still search for each one? If yes, modify your program such that it does not search for repeated keywords. Also, ensure that the output quotes are only displayed once, i.e. there should be no repeating quotes in the output.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started