uselessfacts
Lesson 2 of 7 in Coddy's Random Fact Generator - Python Project course.
As stated before, we will use the public API:
And, more specifically, the end point /api/v2/facts/random which gets a random fact from the API.
Challenge
EasyChange 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"