Grade 6 · unit review

Review: Build Programs with Text and Lists

For text="planet" and values=[4,8,3], find text[1:4],values[1] and len(values). Explain the excluded slice endpoint.

Bring the unit skills together

Use these 4 new cases to check your reasoning. Choices are temporary and are not saved to an account, sent to staff or recorded as school grades. Download your current review choices before leaving or reloading.

Unit review questions
1. Paper Python 3 expression: "music"[2]. What value results?
Need a hint?
  • Label characters from index 0 and select the stated position.
  • Index 1 selects the second character, not the first.
2. Paper Python 3 expression: "marker"[0:4]. What value results?
Need a hint?
  • Include the start index and stop before the stated stop index.
  • Do not include the stop-position character.
3. Paper Python 3 expression: [8,5,1,9][2]. What value results?
Need a hint?
  • Number list positions from 0 and return the value at the stated index.
  • The smallest value is not necessarily the first list item.
4. Paper Python 3 expression: len([[],[1],[]]). What value results?
Need a hint?
  • Count the elements directly inside the outer sequence.
  • Do not replace list length with the sum of its values.

The download contains your current choices and any checked feedback. Keep the separate transfer-task work in your own document; downloading its instructions does not mark it complete.

Use the skills in a new task

For text="planet" and values=[4,8,3], find text[1:4],values[1] and len(values). Explain the excluded slice endpoint.

Work on paper or in your own document. Explain the choices you made.

  • Use only supplied fictional inputs and state the relevant rule.
  • Include labeled steps or evidence for each decision.
  • Name one limitation or tempting mistake.
  • Check that the result meets the task and revise a justified error.
Compare with a model response

text[1:4] yields "lan" at indices 1,2,3; index 4 is excluded. values[1] is 8 and len(values) is 3, not 15. I preserve the given order rather than sorting first.

A different response can also meet the criteria. Compare the evidence and reasoning, rather than copying the wording.