Skip to content
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

Episode 02-loop.md: Improving visualization of the "for loop" #633

Open
pbeukema opened this issue Apr 5, 2019 · 4 comments

Comments

Projects
None yet
4 participants
@pbeukema
Copy link

commented Apr 5, 2019

Link to the lesson: https://github.com/swcarpentry/python-novice-inflammation/blob/gh-pages/_episodes/02-loop.md

Several other instructors in training and I had some difficulty understanding the visualization of the for loop while we were rehearsing this lesson. We thought that a better visualization could help students more clearly understand the logic and execution of a for loop, ideally making use of animation if possible. The graphic I am suggested replacing is below:

Screen Shot 2019-04-05 at 4 10 19 PM

As an alternative to that graphic I created a visualization of the same code block using: http://www.pythontutor.com/visualize.html#mode=display

A screenshot of what that would look like is below:
Screen Shot 2019-04-05 at 4 11 57 PM

Here is code to generate an embedding:

<iframe width="800" height="500" frameborder="0" src="http://pythontutor.com/iframe-embed.html#code=word%20%3D%20'oxygen'%0Afor%20char%20in%20word%3A%0A%20%20%20%20print%28char%29%0A&codeDivHeight=400&codeDivWidth=350&cumulative=false&curInstr=13&heapPrimitives=nevernest&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%5D&textReferences=false"> </iframe>
@maxim-belkin

This comment has been minimized.

Copy link
Collaborator

commented Apr 9, 2019

Thanks for the suggestion, Patrick.
I am aware of pythontutor but would prefer our episodes to be independent of external resources. I'm curious what @annefou thinks about it.

@jdeligt

This comment has been minimized.

Copy link

commented May 14, 2019

forloop_example
Hi @maxim-belkin, I agree with @pbeukema and co that the python tutor is very useful.
If we don't want to rely on external availability maybe we could include a GIF like the one I attached?

@annefou

This comment has been minimized.

Copy link
Collaborator

commented May 14, 2019

I did not know about pythontutor. It is very nice. I agree WITH @maxim-belkin : we should try to have self contained lessons (and try not to rely on external tools) but adding a link (either in the lesson or instructor notes) would be great (and why not with an animated gif too)

@jdeligt

This comment has been minimized.

Copy link

commented May 14, 2019

@annefou @maxim-belkin I have made a pull request for my suggestion to incorporate the image and link to the website. Is there a preference for who to assign this to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.