lundi 31 août 2015

Search multiple keywords in string

I'm looking for a way to complete this task as efficient as possible. Here is how I want it to work.Say user inputs

"My screen is broken"

The script finds the two keywords "screen" and "broken" and then prints an appropriate string. Being a noob I thought I might be able to use a dictionary like this

{"screen", "broken", "smashed":"use a repair kit"}

Then I would just search all the keys in the dictionary. But upon further research it seems this is not possible.

So what would be the best way to do this? I thought maybe sql but I was wondering if there was a better way which would involve just python.Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire