thecodezone.
The Code Zone
Short steps, at your pace · Free lessons and practice · Member video walkthroughs
Save your next small win.

Checking your account…

01.05 · Create and access lists / Practice · 17 min

Select movies, a middle slice and alternate letters

A watchlist, number sequence and letter sequence each need a different selection.

Activity 5 of 5 in Create and access lists

All courses

Python 3: Lists / 01.05

List access challenge

Not started

Apply all three original access tasks with predictable inputs and clear slice boundaries.

More options

Your lesson progress

Walkthrough: not startedPractice: not started

Empty: not started. Yellow: in progress. Green: complete. Marking the whole activity complete does not replace your test results. These circles save in this browser for this pilot.

Rob checks movie endpoints, selects the three number cards 40, 50 and 60, and selects alternating alphabet cards.
Rob’s comic strip · Create and access lists

ORIGINAL WALKTHROUGH · 17:17

Watch with Rob.

Pause whenever you want to try a change. You can return to the lesson at any time.

LEARN WITH THE CODE ZONE

Unlock this video walkthrough

Written lessons and coding practice are free. Video walkthroughs are included with a paid Code Zone membership or an active free trial.

Have a Code Zone website account? Use your learning account’s email to get a six-digit sign-in code, or use your existing website password.

Need a website account? Paid Skool members and active trial members can use the email from their membership questions to request a sign-in code. No invite link or Skool password needed.

Close this window to keep practicing. After signing in, you’ll return to this lesson.

Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.

Open video & code editor (opens in a new tab)

Starter source code for VS Code

Copy the source below or download the file to follow along in VS Code.

The download includes a lesson link in each file and a README so you can find your way back.

main.py
main.pypython · example
# Code along with Rob: List access challenge
# Create five movie titles and print their first/last items with positive and negative indexes.
# Slice 40, 50 and 60 from numbers 10 through 100 by tens.
# Print a, c, e, g and i from letters a through j.
# Predict each result, then press play.

Your task: three original challenges

Keep the five supplied movie titles. Store the first and last movies using positive indexes in first_positive and last_positive, then using negative indexes in first_negative and last_negative. Print those four results in that order.

Keep numbers as 10 through 100 by tens. Assign indexes 3 through 5 to middle_numbers using a slice and print it. For this ten-item list we explicitly mean [40, 50, 60].

Keep letters as a through j. Assign every second item, starting with a, to alternate_letters and print it. The expected list is ['a', 'c', 'e', 'g', 'i'].

Try first, then review Rob’s recording

Watch the original 17:17 challenge walkthrough above. The original Solution Code resource remains in Skool. The website uses fixed titles rather than your personal movie choices so the checks can compare results. Use the separate open workspace when following the source recording.

The checks inspect fixed output and stored values, not the spelling of your index expressions. After passing, change a movie title and predict which results change. Restore the starter inputs for the fixed checks.

Build it one step at a time

Prefer learning by typing? Work through short instructions, run the Python code and check each change before continuing. Your guided project saves separately from the challenge below.

The mini-lesson opens in a new tab. Your own code carries forward; each step has a focused check and an optional hint.

Start mini-lesson(opens in a new tab)

5 steps · Saved work · Instant feedback

YOUR TURN

Select list items and slices

Preserve the three input lists. Store and print the four movie endpoints, then middle_numbers [40, 50, 60] and alternate_letters a, c, e, g, i.

Expected output
Orbit
Byte
Orbit
Byte
[40, 50, 60]
['a', 'c', 'e', 'g', 'i']

Keep the starting inputs. Print these lines in this order, without extra output.

  • Store Orbit in first_positive
  • Store Orbit in first_negative
  • Store Byte in last_positive
  • Store Byte in last_negative
  • Include exactly three middle values
  • Start the alternate letters at a

Edit Python, then run it. Check challenge checks your output and the listed Python requirements. Your code saves on this browser after a short pause. Sign in and choose Save account draft to keep it across devices. Word wrap is enabled.

Ready to checkRun the checks to see your results here.

Need a nudge?

Count the positions

Five items have positive indexes 0 to 4 and negative indexes -5 to -1.

Stop after the final wanted index

Select indexes 3, 4 and 5 with stop 6. A step of 2 starting at the beginning selects a, c, e, g and i.

Replace your editor code?

Your current work will be replaced. Choose Cancel to keep it.

Ready to try it?

Practice in your browser and see your results.

Progress details

Have a question?

Ask the Code Zone community.

Ask a question in The Code Zone (opens in a new tab)

Continue learning

ONE STEP FORWARD

An index returns one item; a slice returns a list. Explain why the stop for indexes 3 through 5 is 6.