Challenge: Cat Fact Analyzer
In this challenge, you will deepen your skills with APIs and text processing in Python. You will use the Cat Facts API to fetch a list of 10 facts about cats. Your goal is to analyze these facts and determine how many of them contain the word "cat", regardless of case. This will help you practice both API requests and basic string searching in real-world data.
Swipe to start coding
Write a function that fetches 10 cat facts from the Cat Facts API and counts how many of these facts contain the word "cat", ignoring case. The function must loop through all facts in the list and check if the word "cat" appears anywhere in each fact, regardless of capitalization. The result must be printed as a single integer.
Soluzione
Grazie per i tuoi commenti!
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Awesome!
Completion rate improved to 10
Challenge: Cat Fact Analyzer
Scorri per mostrare il menu
In this challenge, you will deepen your skills with APIs and text processing in Python. You will use the Cat Facts API to fetch a list of 10 facts about cats. Your goal is to analyze these facts and determine how many of them contain the word "cat", regardless of case. This will help you practice both API requests and basic string searching in real-world data.
Swipe to start coding
Write a function that fetches 10 cat facts from the Cat Facts API and counts how many of these facts contain the word "cat", ignoring case. The function must loop through all facts in the list and check if the word "cat" appears anywhere in each fact, regardless of capitalization. The result must be printed as a single integer.
Soluzione
Grazie per i tuoi commenti!
single