Review: Work with Collections and Defensive Inputs
Given counts={"A":4,"B":7}, retrieve B and test whether 7 appears in[4,7]. Design a 0–10 integer input rule and explain why an alias is not an independent backup.
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.
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
Given counts={"A":4,"B":7}, retrieve B and test whether 7 appears in[4,7]. Design a 0–10 integer input rule and explain why an alias is not an independent backup.
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
counts["B"] is 7 and 7 in[4,7] isTrue. Validate integer type, exclude Booleans and enforce 0–10 before updating. A second name referring to the same list shares mutations, so it is not an independent recovery copy.
A different response can also meet the criteria. Compare the evidence and reasoning, rather than copying the wording.