



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Class: Science and Computers I; Subject: Physics; University: Syracuse University; Term: Fall 2002;
Typology: Lab Reports
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Summary of what you will do: The goal is to for you to gain more practice at Python by writing loops to handle repetitive tasks and to start using the visual module for animation. You will (a) write a simple loop to make a table, (b) modify the plane position calculating program, (c) experiment with the visual module, and (d) use the visual module to make a flying cylinder. Your report for this lab will not be on this handout, but in a document that you create. If you have extensive programming experience, I encourage you to go beyond the examples here, trying more complicated exercises. (See suggestions at the end and try out some of the Visual library.) [607 students: see extended homework.] PYTHON NOTES: There will be a brief lecture on comments, loops, and block statements. You should have reviewed “LiveWires J” on loops. You might want to call it up from the course webpage (under Books & Resources.) Animation in 3D can be done by executing loops to change the attributes of an object, such as its size, position or color. LOOPING
PHY307 HWK ASSIGNMENT #3, due Sept. 10, 2002: Debugging tips: you will run into at least two types of errors while carrying out programming exercises. Fixing these errors is debugging. The first type of error is that where the program doesn’t even run. This is due to some syntax or dynamic error. Fixing these requires carefully checking your typing (did you type yellow or color.yello instead of what should have been color.yellow ?) These fixes also require familiarity with Python and practice looking at examples. The second type of error is where the code runs OK (no crashes) but doesn’t give you what you expect. One approach to finding why the code is not working as expected is to put in lots of print statements. If you think that the width of a cube object assigned to the variable mybox should be 0.7 , for example, you can check your assumption with a “ print mybox.width ” statement at the write place in your program. (The worst kind of error is when everything looks fine, but you are getting the wrong answers and don’t know it. Prevention of this type of error takes experience and careful verification of your code. We’ll worry about this later.) Problems: