Welcome to the Random Joke Fetcher page.
This page contains a brief description and implementation instructions for the project.
Project Description
A fun CLI tool that fetches a random joke from an online API (e.g. Official Joke API) or from a local list. Displays it to the user.
Project Requirements
Python 3.x, requests
(if using an API).
How to Run the Project
- Write a script (e.g.
joke.py
) that either contains a list of jokes or usesrequests.get()
on a joke API. - Run it:
python joke.py
. It prints a joke (setup and punchline) on the console.
Key Concepts Learned
- API Usage (Optional): Understanding HTTP GET requests and JSON parsing.
- Lists: Storing multiple jokes and picking one at random.
- Random Choice: To select a joke if using a local list.
Possible Extensions
- Let the user rate jokes or avoid repeats.
- Fetch specific categories of jokes from an API.
- Create a “Joke of the Day” scheduler (e.g. runs daily).