lc-python-intro
lc-python-intro copied to clipboard
Checkout Suggestion on Python Intro for Libraries Lesson: For Loops page
In the Python Intro for Libraries Lesson: For Loops episode, it might be clearer to new learners if the first 2 blocks of code were reordered. When I've taught this lesson as a demo, I've done it this way and it seems to go very well. After the introduction on what a For loop does, show the steps the "long way" first, then demo the more elegant way of using a loop to accomplish the same task:
- print(2) print(3) print(5)
- This series of print statements is equivalent to a for loop: for number in [2, 3, 5]: print(number)
- And the output for both is the same: 2 3 5
Many thanks @geospatial-gill - we will discuss this suggestion.
Closing since a major update to the lesson will soon be merged, deprecating most standing issues. Thanks for your contribution!