# [closed] Python code for class quiz

### The question has been closed for the following reason "The question is answered, right answer was accepted" by jayesh dalal 28 Feb '12, 20:35

 2 I think the best solution is to save your code in a file as you go, and cut and paste to and from the browser interactive shell as needed. Also, be aware that the syntax for Python3 is slightly different than Python2.6, which is the Python used for this class. For example, print is a function in Python3 (so it needs parentheses), but it is a statement in Python2 (so no parentheses needed). There are many other diferences as well (/ returns floats in Python3, but integers in Python2, some methods that return iterators in Python3 return lists in Python2, unbound methods are gone, no more silent conversion between unicode and bytes, etc). I think your life will be a little easier if you install Python2.6 or Python2.7 instead since that would eliminate a possible source of discrepancies. answered 27 Feb '12, 20:47 Alan Ho 11.0k●5●30●52
 1 I have been doing each assignment in a separate source file like Unit1-5.py, etc. So I start by doing a copy/paste from the browser/video window to my local editor. Once it is working, I paste it back in to the browser window to run and submit it. If you are very very new to python then, pasting it into an online tool where you can step through the code and visualize what is happening may be a useful intermediary step. Then all my source files are committed to my mercurial repository for source control and pushed to my private repository on bitbucket (so I can access it from multiple computers and locations). This will help me later if and when I need to review any of the source. answered 27 Feb '12, 21:23 EdG 6.5k●3●8●37
 0 Course notes contain the code that is in the videos, you can find them in the supplementary material below the video player. But do not use python 3.2: the course uses 2.7 (or 2.6) and the syntax in some cases is different, for instance the print function is different, so you'd better install python 2.7 too answered 27 Feb '12, 20:49 Anna-Chiara ... 5.2k●10●31●75 Thanks. I checked your suggestion and clicked on the "Supplementary Material" when viewing Lesson 1.21 -Inexact Move Function. There was no code listed here! (28 Feb '12, 12:26) jayesh dalal

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

×5,185
×1,705
×323
×319