lundi 20 avril 2020

Python if input statements with similar sentences

I am currently trying to get a voice assistant kinda thing going for which i need to test for a variable in a Sentence, for example

"What will the weather be in 'cityname'"

. The basic thing i kind of figured out with this:

if 'What' in Sinput and ... Sinput is a list with the Input words, better ways are welcome.

But the only problem is that when i do a second if statement which goes for

"What will the weather be in 'cityname' tomorrow"

, both statements will be run and i have yet to find the workaround for this!

Aucun commentaire:

Enregistrer un commentaire