What you'll build
You know random.randint and random.choice. But what *else* is in that box? Learn the one skill that unlocks every library — ask an AI to list a library's functions — then run two of them yourself to prove they are real.
Requirements
The must-do parts. If any are missing, we'll ask you to take another pass.
- Pick a library you have already used —
randomis perfect. Open any AI assistant you like (ChatGPT, Claude, Gemini — your choice). - Paste in a clear question that asks for more of the library's functions. Use the starter prompt below as a template — the trick is to say you are a beginner and to ask for a tiny runnable example with each one.
- From the AI's answer, choose TWO functions you have never used before. Type them into Colab and actually run them.
- Write a short note: which two you tried, what they did when you ran them, and one thing that surprised you.
- Ask a follow-up — "When would I actually use
random.shufflein real life?" — and write the answer back in your own words. - Do the whole exercise again for a second library you have met, like
statisticsordatetime.
Examples
What your program should look like when it runs. Lines starting with $ are typed by you; the rest is your program.
import random
reviewers = ["Dr Owusu", "Dr Sen", "Dr Mensah"]
random.shuffle(reviewers)
print(reviewers) # -> ['Dr Sen', 'Dr Mensah', 'Dr Owusu']
print(random.sample(range(1, 50), 3)) # -> [12, 7, 41]Where to start
Copy this scaffold into a new file. You don't have to use it — it's just a friendly nudge.
Paste this into any AI assistant. Swap "random" for any library you want to explore.
I'm a beginner learning Python. I already know that the random library
has randint and choice. List 6 more useful functions from the random
library. For each one, give me:
- its name and what it does, in one plain sentence
- a tiny example I can paste straight into a Colab cell and run
Keep it simple — no advanced features, no extra libraries.How we'll grade it
Four checks, four points. Three or above is passing — we'll ask you to revise anything we can't tick.
| Check | What we look for | Pt |
|---|---|---|
| Asked a clear question | The prompt names the library, says you are a beginner, and asks for small runnable examples. | 1 |
| Ran it yourself | At least two new functions were actually typed into Colab and run — not just copied out of the AI's reply. | 1 |
| Output is shown | Your note shows what the two functions printed when you ran them. | 1 |
| In your own words | The surprise or takeaway is written by you, not pasted from the AI. | 1 |