AssignmentsWeek 03 · Data and the outside worldAsk an AI what else is in the box
wk03.p6Practice exerciseWeek 03 · Data and the outside worldOpen · due this week

Ask an AI what else is in the box

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.

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.

  1. Pick a library you have already used — random is perfect. Open any AI assistant you like (ChatGPT, Claude, Gemini — your choice).
  2. 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.
  3. From the AI's answer, choose TWO functions you have never used before. Type them into Colab and actually run them.
  4. Write a short note: which two you tried, what they did when you ran them, and one thing that surprised you.
Bonus, if you're feeling brave
  • Ask a follow-up — "When would I actually use random.shuffle in real life?" — and write the answer back in your own words.
  • Do the whole exercise again for a second library you have met, like statistics or datetime.

Examples

What your program should look like when it runs. Lines starting with $ are typed by you; the rest is your program.

After the AI answers, you run two of its suggestions yourself
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.

CheckWhat we look forPt
Asked a clear questionThe prompt names the library, says you are a beginner, and asks for small runnable examples.1
Ran it yourselfAt least two new functions were actually typed into Colab and run — not just copied out of the AI's reply.1
Output is shownYour note shows what the two functions printed when you ran them.1
In your own wordsThe surprise or takeaway is written by you, not pasted from the AI.1
Ready?
Hand it in
You can submit a draft and revise later if you're not done.
Begin submission →