Introduction to Computational Thinking Blockly Lists Iteration C
Introduction to Computational Thinking Blockly Lists & Iteration (C) Dennis Kafura 1
CT@VT Things we are seeing n n A list is a data structure that represents an abstraction with multiple instances Simple lists have instances with only one property q n n n e. g. , each instance (day) in the forecast weather abstraction is represented by a single property (temperature) A list represents a “big data” data set Block. Py blocks return a list Block. Py has blocks for iteration Use iteration to process a data set (i. e. , a list) Different patterns for processing a data set q q Uniform Accumulate Filter Transform (C) Dennis Kafura Slide 2
CT@VT Patterns n n Uniform: perform the same processing on each element of the list Accumulate: determine a property of the list Filter: use a decision to select some elements of the list for processing Transform: produce a new list by processing the elements of an existing list (C) Dennis Kafura Slide 3
CT@VT Thinking about iteration middle start end (C) Dennis Kafura Slide 4
CT@VT Accumulate pattern middle property (C) Dennis Kafura Slide 5
CT@VT Finding the total middle 7 10 15 9 2 14 4 32 34 10 7 15 2 9 (C) Dennis Kafura 14 4 Slide 6
CT@VT Finding the total beginning 7 10 15 2 9 14 4 0 end 10 7 15 2 9 14 4 61 (C) Dennis Kafura Slide 7
CT@VT Next steps today n Work on the assigned Blockly and list problems in the book using iteration and decision q q n n Work as an individual Seek help from and provide help to your cohort Go as far and as fast as you can remembering to keep everyone in your cohort on board Cohort feedback/reports (C) Dennis Kafura Slide 8
- Slides: 8