-
-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flowchart illustration for for loops #815
Comments
Hi George, I think it could be helpful to learners to see a flowchart of a for loop as you suggest. Maybe something akin to the structure of here: https://www.rff.com/flowchart_structure_for_loop.png? The condition "Done with collection iteration?" makes sense to me, or in the example of the print character example, "Processed all characters in word?" . Regarding the body, to me, "Get next item in collection" seems more in line with incrementing the loop variable than being the body. I see the body being more along the lines of "Do task" or in the case of the character example "Print character". If you find time to submit a pull request for this, we welcome it. Thanks for bringing up this issue for discussion. |
Hi, Following the existing flowchart in episode 07, I did not include the start/stop terminals however I am not too happy with the way the Yes-arrow runs into nowhere - any thoughts/suggestions? Looking forward to hearing your thoughts on this! (Image is available as svg but can't be attached in that format) |
I think it is great you joined this issue @RaphaelaHeil ! I think your image helps to give an idea of a |
Hi all! My apologies to all of you for taking so long to write this response. I have to admit that it took me longer than usual to formulate (for myself) my thoughts on this issue. So, here is what I think:
So, all in all, I'd say that suggested flowchart would definitely improve our lesson. This flowchart is specific to the first
The first point above comes from the fact that if I didn't know Python and were to look at the flowchart, I wouldn't know if the keyword is By "unexplained components" I basically meant "Yes" arrow going out from the "processed all characters" -- what happens at the end of that arrow? Finally, what I'm trying to say in the last point above is that our learners might be very new to programming in Python and we should be careful about using syntax that looks-like Python code but in reality is not. In the proposed flowchart I see couple of such examples: I decided that because it took me so long to formulate my thoughts and write this response I had to provide a visual explanation of what I mean by all of the above. So, below are my drafts that, while don't solve all the issues, make a step in that direction. I suggest we continue the discussion, decide on what should be in the visual, improve it until we all agree and then create a PR. I'd be happy to share originals of my drafts if we decide to use one of them as a starting point. Again, thank you all for the discussion and apologies for the delay. Maxim |
In teaching sequential programming languages, flowcharts are very useful illustration to mimic the step by step instructions as the processor executes them
I suggest adding a flowchart to illustrate how loop works in lesson 4 "Repeating Actions with Loops". I see that flowcharts where used to illustrate "if statements" in lesson 7 "Making choices". The for loop flowchart can further be demonstrated with the print character example.
The for loop flowchart consists of a terminating condition and a body. To keep it simple, the condition can be stated as: "Done with collection iteration", the simplest body would be "Get next item in collection"
I appreciate your comments.
The text was updated successfully, but these errors were encountered: