Created
April 21, 2020 08:34
-
-
Save BMU-Verlag/3c8b01303b4eb0a2f0eff8a2738e1069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate_articles(articles): | |
valid_articles = [] | |
for article in articles: | |
if ('url' not in article or 'target_price' not in article): | |
continue | |
if ('amzn.to' not in article['url'] or type(article['target_price']) | |
is not float): | |
continue | |
valid_articles.append(article) | |
return valid_articles |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment