Suppose I have two lists like:
list_of_urls = ['https://en.wikipedia.org/wiki/Barack_Obama', 'https://en.wikipedia.org/wiki/President_of_the_United_States', 'google.com']
list_of_blacklisted_urls = ['wikipedia']
How to return True
if any part of the blacklisted url is in the list_of_urls? I have tried:
for url in list_of_urls:
if any(URL in URLs for URL in list_of_blacklisted_urls):
return True
But I'm quite sure this doesn't work.