Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Cat Fact Analyzer | Advanced API Usage and Data Processing
Quizzes & Challenges
Quizzes
Challenges
/
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.

Uppgift

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.

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 4
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

close

bookChallenge: Cat Fact Analyzer

Svep för att visa menyn

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.

Uppgift

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.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 4
single

single

some-alt