So I am trying to code this thing that lets you open pages on the web. I am using def functions to define the code and stating those in a while True loop. This is my code:
import webbrowser
cd = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"
#opening web pages
def yt():
print ('Opening...')
webbrowser.get(cd).open('youtube.com')
#loop code
while True:
query = input()
if 'open yt' or 'open youtube' in query:
yt()
else:
break
So here when I take the input as 'open yt' or 'open youtube', it opens the desired web page but when the input is something else, instead of breaking the loop and ending the code, it opens YouTube again. I am not able to understand what is happening as I am a bit new to this kind of code. Please help.