![Picture](/uploads/1/2/4/7/12475677/5085644.png?69)
Although there are lots of resources available on the web to help students learn Visual Python, I wanted to write about my own experience getting the process started in a classroom. This post represents my distilled experience in both AP Physics - Mechanics C, and in an algebra-based physics class with sophomores and juniors.
Lesson Plan Below is a detailed lesson plan I did in class with my students. My school operates on a block schedule with 75 minute blocks per class: 1. Students open IDLE environment. If the shell opens, have them open a new window. 2. Have them type the following code: from visual import* sphere() 3. ![]() At this point have students open the tutorial document. Explain the following points to them:
5. As the students code, they will find that the code does not behave as they think it should. The language in the tutorial explains why. Draw their attention to this in the tutorial 6. When a student succeeds in making a ball bounce off a wall, have the student walk you through the logic of why the conditional works to make the ball bounce. The code looks like this: if ball.pos.x > wallR.pos.x:     ball.velocity.x = -ball.velocity.x 7. They will then realize that bouncing off a second wall requires a tweak to this code. Walk them through the logic and only give them more help if it seems that they will not be able to figure it out. 8. They will find themselves more or less self-sufficient at this point. Some will be comfortable enough that they will experiment with different colors, ball sizes, rates etc. This is all to the good. 9. If students are done early, give them additional challenges such as
| Before Class 0. Each student should have a single laptop or desktop computer with Visual Python installed, and the document Vpython_Intro.pdf 1. VPython Website to download and install VPython: 2. Link to the tutorial (click where it says Tutorial) or just download the attached file below 3. Lesson plan summary to download and have on-hand in your classroom: ![]()
![]()
Caveats It has been my experience that after the first few minutes of independent coding, they will start making many syntax errors. When this happens inform them that common errors include misspellings, improper indentation, and missing punctuation. Remind them that this is what they should check for whenever their code fails to run. Also when they have to adapt their code to new problems, there may be some initial resistance. Asking probing questions and having them explain how their existing code works often gives them the ability to deduce what their new code ought to look like. Finally, some kids will be very comfortable with code, and others may need more help. After awhile the students will probably start looking at each others code to get ideas. I have found this to be a good thing, in that the majority of students are engaged and are looking for a small hint to get them through a challenge rather than copying and pasting code. Finished Product |