+ 5

How to search for multiple items in a list when input is entered by user in python?

what will be the code to search for item "drink,snacks" from a list menu= "pizza,snacks,milk,fruits,drinks". the output should search for both items and produce output in separate lines.

18th Jul 2018, 7:43 PM
Monika singh
Monika singh - avatar
2 Answers
+ 10
Try with intersection of two sets.
18th Jul 2018, 8:13 PM
Oma Falk
Oma Falk - avatar
+ 1
regular expressions does a better job
21st Jul 2018, 7:45 PM
Phillimon M Phiri
Phillimon M Phiri - avatar