Menu
Coddy logo textTech

uselessfacts

Lesson 2 of 7 in Coddy's Random Fact Generator - Python Project course.

As stated before, we will use the public API:

https://uselessfacts.jsph.pl/

And, more specifically, the end point /api/v2/facts/random which gets a random fact from the API.

challenge icon

Challenge

Easy

Change our function to return the endpoint (https://uselessfacts.jsph.pl/api/v2/facts/random)

You should go to this url and check what it returns! you can refresh to see it generates other responses!

Try it yourself

def get_fact():
    return "some fact"

All lessons in Random Fact Generator - Python Project