Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Cat Fact Analyzer | Advanced API Usage and Data Processing
Working with APIs in Python

bookChallenge: 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.

Taak

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.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Suggested prompts:

How do I fetch data from the Cat Facts API in Python?

Can you show me how to count occurrences of the word "cat" in the facts?

What Python libraries do I need to complete this challenge?

close

bookChallenge: Cat Fact Analyzer

Veeg om het menu te tonen

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.

Taak

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.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 4
single

single

some-alt