Day 5
Mini Project 1
Due Friday before class. Don’t hesitate to reach out for help via office hours and slack.
Reading Journal Review
Collected Day 4 reading journals
As we discussed last time, state and stack diagrams are extremely useful for reasoning about code, especially with mutable objects like lists. We can use Python Tutor to visualize the difference between middle and chop.
Iteration
Quick check: Compare and contrast lists and strings
One thing they have in common are that both are “iterables” - we can iterate over all the characters of a string or over all the elements of a list.
Read about iteration design patterns. Don’t forget to practice active reading with hands on keyboards trying things out! (This reading is a Jupyter notebook, and the download link for the source code is down at the bottom).
Exercise
Which iteration patterns does the grocery store receipt program you wrote last time use? Rewrite it to use another coding style that you learned about in the reading.