0
Help, it's urgent!!
Whenever I input 'YouTube' it opens YouTube But whenever I input something else then also it opens YouTube Plz help Disclaimer: You will require a pc or laptop to view this becz it contains pyttsx3 https://code.sololearn.com/cK8MQy1jy9U7/?ref=app
3 Respostas
+ 2
Idk how this engine works, but this line:
if 'youtube' or 'Youtube' or 'Open youtube' == input_user
evaluates 'youtube' as being different from False and executes that.
It should be:
if 'youtube' == input_user or 'Youtube' == input_user or 'Open youtube' == input_user:
Although I would suggest:
if 'youtube' in input_user.lower():
The same with the google one.
+ 1
Same question:
https://www.sololearn.com/Discuss/3082598/?ref=app
0
Kaushik
if 'abc' will always return True because it is a value and you are not comparing with any other value
if Earth => True
if Earth == Moon => False because both are not same
if 'Kaushik' => True
if ('Kaushik' == 'AJ') => False
if ('Kaushik' == 'Kaushik') => True