Computer science is no more about computers than astronomy is about telescopes.
—Edsger W. Dijkstra
This lecture course is a rigorous introduction to computer science and the art of computer programming, using the elegant, eminently practical, yet easy-to-learn programming language Python. We will learn the principles of problem solving with a computer while gaining the programming skills necessary for further study in the discipline. We will emphasize the power of abstraction and the benefits of clearly written, well-structured programs, beginning with imperative programming and working our way up to object-oriented concepts such as classes, methods, and inheritance. Along the way, we will explore the fundamental idea of an algorithm; how computers represent and manipulate numbers, text, and other data (such as images and sound) in binary; Boolean logic; conditional, iterative, and recursive programming; functional abstraction; file processing; and basic data structures such as lists and dictionaries. We will also learn introductory computer graphics, how to process simple user interactions via mouse and keyboard, and some principles of game design and implementation. All students will complete a final programming project of their own design. Weekly hands-on laboratory sessions will reinforce the concepts covered in class through extensive practice at the computer.
Open to any interested student.
Prof. Jim Marshall
Office: Ilchman Science Center 100
Phone: 2673 (from off campus: 914-395-2673)
Email: j + my last name + @sarahlawrence.edu
Python Programming, 3rd Edition
by John Zelle
Think Python, 2nd Edition
by Allen B. Downey
Weekly rhythm: Learning to program in Python is like climbing a staircase. You can't reach the higher steps if you don't first make it up the lower steps. Each week, we will take the next step up the staircase by studying a new set of programming concepts, but the new concepts will always build on concepts from previous weeks. Each Wednesday in lecture, I will introduce the new concepts for that week. On Thursday, you will practice these concepts during your lab session. In lecture on Friday, we will go into more depth and see further examples, after which I will post your homework assignment, which will be due the following Wednesday night. This weekly rhythm will continue throughout the semester. During the final three weeks, you will have the opportunity to create a substantial program of your own design.
Lab sessions: In addition to the Wednesday/Friday lectures, you will have a lab session each week on Thursday, starting either at 11:05 am or 2:00 pm. The lab sessions are mandatory, but you only need to attend one lab session per week. The purpose of the labs is to give you time for hands-on, structured practice with Python programming, and the opportunity to ask questions and receive individualized help. At the beginning of each lab session, I will hand out a worksheet with a set of programming exercises for you to work on at your own pace or with a lab partner. The lab exercises will typically be due the following week as part of your homework assignment.
Group conferences: In addition to the lectures and labs, two 60-minute group conference sessions will be held each week on Wednesday, for students desiring extra practice and discussion of the course concepts. Together we will go over your questions, review material from class, and work through further examples, but I will not introduce new course material. Group conferences will usually be optional, and any student is welcome to attend. However, depending on your own rate of progress with the course material as the semester proceeds, I may require you to attend one session per week. In any case, all students enrolling in the course must ensure that their weekly schedule does not conflict with at least one of the group conference meeting times.
On-time attendance is required and expected for all lectures and lab sessions. Given the fast-paced, cumulative nature of the course material, students who miss class risk quickly falling behind, and catching up can be difficult. At the beginning of each lecture, I will pass around an attendance sheet, which you should make sure to sign. If you arrive late and forget to sign the sheet, you will most likely be counted as absent that day. Although I realize that missing class sometimes cannot be avoided, your cumulative attendance record in lecture and lab will influence your final course grade, and you may receive reduced course credit if you miss more than 2 lab sessions, for any reason. If you are unable to attend lecture or lab, please contact me about it as soon as possible. No student will be admitted to the course after the add/drop period ends.
We will have a 15-minute written quiz at the beginning of lecture every other Friday during weeks 3 through 11 of the course. Each quiz will consist of two questions asking you to read, write, and understand short pieces of Python code, and you will not be allowed to consult your computer, textbook, phone, classmates, or any other supporting materials. The quizzes are intended to serve as a "reality check" to assess how well you have understood basic programming concepts. They will not be difficult if you have been keeping up with the course material. However, based on your performance on the quizzes (or homework assignments), I may ask you to begin attending one of the weekly group conference sessions. The best way to prepare for the quizzes is to do the lab and homework assignments consistently each week, and to review the Discussion Questions at the end of each chapter in the textbook. At the end of the semester, I will drop your lowest quiz score. The quizzes will start promptly at 9:30 am and end at 9:45, and no make-up quizzes will be given under any circumstances, so plan accordingly.
I will often send out announcements to the class through email, so you are expected to check your Sarah Lawrence email account at least once per day. I will use your @gm.slc.edu address because it is reliable and easy to remember. You should also check the course web pages frequently for code examples discussed in lecture, and for the homework assignments. I will be happy to answer your questions by email and will try to respond as quickly as possible to messages that pertain to the course.
The weekly homework assignments are the heart of the course. Assignments will be posted at the end of each week, and will be due the following Wednesday night by 11:59 pm. Most assignments will involve writing, testing, and debugging Python code. We will start out writing many small, simple programs, and gradually progress to larger-scale and more challenging tasks. You should expect to spend a substantial amount of time — several hours, at least — outside of class each week working on the assignments. Fortunately, programming is a lot of fun, and many students are surprised to find that they eagerly look forward to doing their programming assignments each week!
You will use a web-based submission system to turn in your Python files for each assignment. More details about using this system will be provided in class. Please DO NOT email your homework to me.
You should always include your name and the assignment number in a comment at the top of each file that you turn in.
Start each assignment as early as possible. Don't wait until the day before it is due. "I can't get Python to work on my computer!" or "My computer crashed!" or "I accidentally deleted my files!" are not acceptable excuses for failing to complete an assignment on time. You should always make backup copies of your files to avoid this type of situation.
Assignments submitted by the Wednesday night deadline will receive full credit. However, if you are unable to complete your assignment on time, you can still receive most of the credit if you complete it and submit it during the 3-day "grace period" from Thursday up to Saturday midnight. This will give you some extra time to seek further help or clarification from me. Assignments received after the grace period expires may be substantially penalized.
On some homework assignments, you may work with a partner if you wish, but you must consult with me in advance about this and obtain my permission. No more than two people may work together, and you and your partner are required to participate equally in designing, writing, and debugging your code. Furthermore, you must agree to work as a team before starting on an assignment. When working with a partner, please submit only one copy of your files. However, make sure to include both of your names in a comment at the top of each file. If you forget to include both names, only one person will receive credit.
The code that you submit must load into Python without generating any syntax errors. Code that cannot be loaded will be severely penalized.
Toward the end of the semester, you will have an opportunity to go beyond the assigned homework exercises by developing and implementing a substantial program of your own design. This will allow you to synthesize the programming concepts you've learned in class in a more creative and personal way, according to your own interests. There are many possibilities: games, graphics, simulations, etc. — your imagination is the limit. You will have three weeks to work on your mini-project. A short written project proposal will be due by the beginning of Thanksgiving break, and your completed program in final working form, along with a short project writeup, will be due on the last day of the semester (Friday, December 17). More information about the mini-project will be provided in class.
Your programs will be evaluated on both functionality and style. As expert programmers know, programming is about more than just getting your code to run correctly on a computer. It is a highly creative activity akin to an art form, which relies as much on a sense of aesthetics and style as on technical mastery of the programming language. Programs should be written primarily for other programmers to read and understand, and only incidentally for machines to execute. Thus it is very important for you to develop a clear and consistent programming style, making good use of comments, white space, and well-chosen variable names. Your code should follow these general stylistic guidelines:
Homework assignments are evaluated on both the functionality and style of your code, according to the following rubric. To receive a ☆, your code must not only work perfectly, it must also be logically well-organized and easy to read (see the above stylistic guidelines).
|☆||Work of excellent quality that clearly meets or exceeds all of the assignment expectations. All programs work correctly on all of the input data, and are written in a clear, easy-to-read style.|
|✓+||Work of very good quality that meets most of the assignment expectations. Programs work correctly or mostly correctly for most of the input data, though some programs may have a few minor deficiencies or stylistic problems.|
|✓||Work of satisfactory quality that meets some of the assignment expectations and reflects a good effort overall, despite some deficiencies. Some programs work correctly or mostly correctly for most of the input data, but may have significant stylistic problems or other shortcomings.|
|✓−||Work of subpar quality that falls short of assignment expectations and needs improvement. Some programs have serious deficiencies, and work incorrectly for a significant portion of the input data. Nevertheless, the work shows some degree of effort and understanding.|
|−||Work of poor quality that exhibits severe problems, reflecting minimal effort or understanding. Many programs crash or work incorrectly for most or all of the input data.|
At times you may find some of the course material to be quite daunting. But don't be discouraged! If you find it difficult, most likely so does the rest of the class. This is just a normal part of the process of learning to program. You are strongly encouraged to contact me as soon as possible whenever you are having difficulty with the material. You should also be sure to attend one (or even both) of the weekly group conference sessions, during which we will discuss whatever concepts students are having trouble with, and work on practice exercises together. In short, if you are confused about something, don't stay that way! Staying confused will only make things worse later (remember the staircase metaphor). Contact me as soon as possible so that we can clear up the problem. There is no point in staring at the computer screen for hours trying to figure out why your code won't work, when just a few minutes is often all it takes to track down the problem together. I'll also be happy to answer questions over email or schedule a meeting with you on Zoom.
Our lab assistants will be available this semester for informal help and tutoring with Python programming, according to the following schedule. All tutoring will take place in the Learning Commons space on the main floor of the SLC Library. This service is free, and no appointment is necessary.
Do the reading before you come to class. Don't worry about total comprehension, but at least get a feel for what we will be covering. If you have some understanding of the material coming in, it will be easier for you to ask questions during class, rather than later, when I might not be available. Additionally, I will often discuss code examples in detail during class. If you have already done the assigned textbook reading, the examples will be much easier to follow.
Ask questions if you don't understand. This means both during class and while doing your homework. This course continually builds on previous material (the staircase metaphor again), so if you don't understand something one week, it will continue to be a problem the next week, and the week after that, and so on — until you finally do understand it. If you need help, contact me by email, come to group conference, ask me about it during lab or after class, or ask your classmates — but first read the Collaboration Policy below.
Start the homework assignments early. I realize this is not always easy to do, but if you can get into the habit of starting early, you will be much better off. Here are two reasons to start early: (1) if you get stuck, there will be time to ask for help before the deadline; (2) you can always walk away, go do something else (like sleep), and come back later. I find I always have at least a few new ideas when I come back in a fresh state of mind. If you wait until the last minute, you can't do this.
Practice, practice, practice. The only effective way to learn this material is to consistently do the lab and homework assignments. Finish all of the assigned programs — and maybe even do some extra ones for fun! Even if you don't get them done on time, they will still help you learn the material.
If you have a disability that may interfere with your ability to participate in the activities, coursework, or assessment of the objectives of this course, or any of your other courses, you may be entitled to reasonable accommodations. Please contact Polly Waldman, Associate Dean of Studies and Disabilities Services located in Westlands 116. You may also call Disability Services at 914-395-2235 or email pwaldman at sarahlawrence.edu. Under the Americans with Disabilities Act and Section 504 of the Vocational Rehabilitation Act of 1973, all students, with or without disabilities, are entitled to equal access to the programs and activities of Sarah Lawrence College and the College will make reasonable accommodations when appropriate and necessary.
The highest level of academic integrity is expected of every student. You are strongly encouraged to discuss ideas and approaches to solving problems on a general level with your fellow classmates, but you are not allowed to share your program files, code, or solutions with others, or to make use of another student's code or solutions obtained via email, the Internet, or any other means of communication. I can almost always tell when two different programs derive from the same original source code, even if cosmetic changes have been made to it. The code you hand in must have been written by you from scratch, with the following permitted exceptions: code provided in class by me, code from the textbook, or code developed together with a partner if you are collaborating on a lab or project with my knowledge. In this case, you and your partner may freely exchange code developed as a team, and are jointly responsible for the work submitted. Under no circumstances may you hand in work under your own name that was done by someone other than yourself or your partner.
In all cases, if you make use of any code that was written by someone else in your assignment, including your partner, you must clearly acknowledge this in your code. This also goes for any help obtained via the Internet. When in doubt, credit the people or sources from whom you got help. If you are ever unsure about what constitutes acceptable collaboration, just ask. You are also responsible for carefully reading the College's official Policy on Academic Integrity in your SLC Student Handbook. Failure to abide by these rules is considered plagiarism, and will result in severe penalties, including possible failure in the course. Please do not put me, yourself, or anyone else in this unpleasant situation!