← Back to the Introduction to Computer Science outline The Course Maker
← Introduction to Computer Science outline
Week 6 · Readings & resources

Week 6 — Readings & Resources

Introduction to Computer Science Free sample edition

Your primary reading is Chapter 6 (in this module). Everything below is the optional, go-deeper layer — pick what helps, skip the rest.

How to use this page

This page has 11 items (5 readings and 6 videos). Allow 67–84 minutes for everything. Each group points back to the matching chapter section and class-session segment, so use the full menu when you want more, or take the quick path below.

Every video here has captions: turn them on with the CC button in the player. The chapter covers the same ideas in text.

Pick-one quick path (18–21 min total)

① Repeating with for and range

Chapter 6, Section “Repeat a known number of times: for and range” · Session 1, Segment 2, “for and range” · Remember: a for loop makes one pass per item, and with a step of 1, stop minus start is the number of passes in a range.

  • Python for loop — Bro Code — a short demo that loops over range(10), over a stepped range that counts by 2, over the letters of a string, and finally counts down for a New Year timer; pause before each loop runs and predict its first and last values. Use it while working through the Week-6 module overview. (video, 6 min) (captions: creator)
  • Python Intro Ep 12, Looping over a range() of Integers — Russell Lewis — a calm explainer on writing a loop that counts from 0 up to a number you choose; listen for where the count stops and check it against the exclusive stop. This builds on Week 5's work with while loops, counters, and accumulators. (video, 6 min) (captions: creator)
  • Demo: Loops, Python for Beginners 28 of 44 — Microsoft Developer — a three-minute live demo of loops working through a collection of items; focus on the shape of the for line and its indented body, and treat the collection itself as a preview of Week 9's lists. (video, 3 min) (captions: creator)
  • Loops — learnpython.org — a one-page lesson with an in-browser exercise; read The for loop section, where range() starts at 0 unless you give a start (its note on xrange is about an older Python and does not apply), and skip the while, break, and else sections, which this week does not need. Stop before the site's next lesson, on functions; next week, Functions, takes that up. (reading, 5–8 min)

② Where a range stops, and totals with for

Chapter 6, Section “Read a range: three forms and the exclusive stop” · Session 1, Segment 3, “Reading a range” · Remember: a range with no start begins at 0, and its stop is never one of its numbers.

③ Loops inside loops

Chapter 6, Section “Nest one loop inside another: grids, tables, and counting lines” · Session 2, Segment 6, “Nested loops” · Remember: the inner loop finishes all its passes on every pass of the outer loop, so lines equal outer passes times inner passes.

  • Python nested loops — Bro Code — a short demo that asks for a number of rows, a number of columns, and a symbol, then prints a grid with end set to an empty string and a bare print() after each row; predict the grid before it appears. (video, 5 min) (captions: creator)
  • Nested Loops, Visually Explained — Visually Explained — an animated look at how an inner loop runs all of its passes on each pass of the outer loop, and when nesting is the right tool. (video, 7 min) (captions: automatic)
  • The 2 by 3 nested loop, step by step — Python Tutor — the chapter's six-line nested loop loaded in the visualizer; click Next and watch j run through 0, 1, and 2 before i moves on, then count the output lines. (reading, 5–8 min)
  • Python for loop — DigitalOcean — a community tutorial; read the parts on printing the letters of a string, nesting for loops, and the for loop with range(), and skip the list, break, continue, and else parts. (reading, 8–12 min)

Optional one-stop reference (free online reference)

Heads-up (links rot): these point to outside sites that occasionally move or rename pages. If a link ever fails, tell your instructor and use the reference above in the meantime.

Provenance: Built with The Course Maker · samples.thecoursemaker.com