AssignmentsWeek 02 · Decisions and structureScholarship shortlist printer
wk02.p6Practice exerciseWeek 02 · Decisions and structureOpen · due this week

Scholarship shortlist printer

Keep several scholarships under one label, then walk through them with a for loop and print each on its own line. The cleanest way to practice a list and a loop together.

What you'll build

Keep several scholarships under one label, then walk through them with a for loop and print each on its own line. The cleanest way to practice a list and a loop together.

Requirements

The must-do parts. If any are missing, we'll ask you to take another pass.

  1. Make a list of at least four scholarships (or universities) you're interested in.
  2. Use a for loop to print each item on its own line — one print() you write once, not four.
  3. After the loop, use len() to print how many are on the list.
  4. Use a four-space indent for the line inside the loop, and end the for line with a colon.
Bonus, if you're feeling brave
  • Number each line as you print it — 1. Chevening, 2. DAAD, and so on. Look at how enumerate() works, or keep a counter that starts at 1.
  • Add a second indented line inside the loop that prints a short note, so two lines come out for every item.

Examples

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

Example cell runs
Chevening UK
DAAD Germany
Mastercard Foundation Canada
Fulbright USA

4 scholarships on your shortlist.

Where to start

Copy this scaffold into a new file. You don't have to use it — it's just a friendly nudge.

# Scholarship shortlist printer

scholarships = [
    "Chevening — UK",
    "DAAD — Germany",
    # TODO: add at least two more
]

# TODO: use a for loop to print each one on its own line

# TODO: print how many there are with len()

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
It runsStarts cleanly and prints the list without errors.1
Real list and loopThere is an actual list with four or more items, and a `for` loop walks it — not four separate print statements.1
Count is correctThe final line uses `len()` and shows the right number for the list.1
Reads wellOne item per line, clean output, no debug noise.1
Ready?
Hand it in
You can submit a draft and revise later if you're not done.
Begin submission →