CS 1

About the course

CS 1 will teach you to design, write, and analyze code to solve computational problems from a range of disciplines. You’ll also learn to think about problems the way a computer scientist thinks – a skill that is valuable in any field. The course is suitable for students with no previous background in Computer Science, and no knowledge of mathematics beyond high-school algebra.

CS 1 fulfills the TLA distributive requirement, and is the introductory course for the Computer Science major and minor.

Lecture location

Life Science 100

Class times

Textbook and software

There is a free on-line textbook for the course, Project Python. Links to the relevant sections of the text will be posted for each lecture on the schedule page. We wrote the text as lecture notes for this course. Reading the text and doing the exercises in it daily are necessary to do well in this course.

We will be using PyCharm to edit and run code. You will install this software on your own computer as part of the first short assignment.

All documents, video recordings, class examples, lab assignments, short assignments, and sample solutions related to the course will be either on the site you are viewing now (I recommend that you use Chrome to view this site as some of the interactive features are not compatible with all browsers) or on the course Canvas page.

Teaching team


Andrew T. Campbell

Office hours

Office hours directly after class Monday and Wednesday 2-3 pm location LSC100.

Coffee hour Friday after class at Fern with small groups.

Section leaders and TAs

Office hours

There are a considerable amount of office hours available so please use them. Each TA and section leader will hold three hours of office hours per week. The office hours will be posted on Canvas homepage.

Graduate TAs


I appreciate your participation during the lecture when you ask questions. It’s highly likely that other students have similar questions, so it benefits everyone when you ask. In class, I don’t rely on slides as much and prefer to use the whiteboard and live coding. You’re welcome to code along with me or simply listen to the lecture. I’ll provide you with my code at the end of each session via canvas.

Before we start the lecture, please ensure that your phone’s audible ringer is turned off. Additionally, I kindly request that you refrain from checking your phone during the lecture as it can be distracting for both me and other students.

Recitation sections

As part of the course, there are eight small group recitation sections that meet once a week, each lasting one hour. These sessions, which begin in week 2, are led by section leaders and involve solving small incremental problems, either through programming or written work. Attending these recitation sections and completing the associated problems accounts for 10% of the final grade.

To be marked as present, it is mandatory to attend your own designated recitation session. As a part of Short Assignment 0, you will be required to fill out a form indicating your availability for the sections. You will then be assigned to a section based on your availability. It is important to attend the same recitation period with your designated group throughout the course to receive a grade.

Coursework and grading

The main objective of this class is to help you become a proficient Python programmer. To achieve this, the course is designed with various short and long programming assignments. As with any new language, you will learn from the mistakes and bugs in your code. However, I guarantee that by completing all the programming assignments, you will gain a solid understanding of programming. My advice is not to focus solely on grades but to aim to complete all the assignments and acquire a new cool skill. This class is primarily about learning rather than grading or penalties. That being said, let’s discuss grading in more detail.

Throughout the course, you will be given 9 short assignments, 4 labs, 8 recitations, 3 x-hour tests, and 2 exams (midterm and final). All tests and exams will be closed book and written without use on your computer. The weightage of each category in your final score is as follows:

I will be following an absolute grading policy for assigning a letter grade in this course:

In-person exams and x-hour tests

There are a total of three x-hour tests and two exams, namely the midterm and final exams, which will all be administered in-person and will be closed book, written exams. The dates for these assessments are already set at the beginning of the term and will not be subject to change. You can refer to the schedule to check these fixed dates. Additionally, the final exam will take place in-person during the exam period at the end of the term.

Make-up dates for tests and exams will not be available. In the event of an emergency that prevents you from taking a test or exam, I will need to be notified beforehand. Additionally, your student dean must provide me with an explanation of the nature of the emergency situation. If these conditions are met, we can plan for a make-up test or midterm. However, please note that the make-up tests and midterms will comprise of different questions compared to the original ones.

Short assignments

Short assignments are relatively brief exercises that are usually due in two or three days. Short assignments will usually consist of one or two short programs to help you understand the concept being covered.

Section leaders will grade your short assignments on a scale of 0 to 5.

Lab assignments

There will be four in-depth lab assignments; you will have one week to work on each lab. You may use your own computer wherever you like, just as you do for short assignments.

Lab assignments require a significant time commitment. Start early, and if you need to, get advice from me, the section leaders or the TAs. For each lab, there will also be a checkpoint, due a few days after the lab is assigned. Checkpoints will be graded as part of your lab grade.

4 free extensions

You can use 4 extensions (upto 24 hours each) for short assignments and checkpoints/final lab assignments. There won’t be any penalty when you use these extensions. To use your free extension you have to email your section leader and CC Andrew Campbell.

Lateness policy

Once you have used all your free extension, there will be a 0.5 point lateness penalty for every late day. Even if your assignment is late by few hours we will count it as a late day.

Extra credit

Some of the assignments may suggest extra credit work. Extra credit in this course will be tallied separately from regular scores. If you end up on a borderline between two grades at the end of the course, extra credit will count in your favor. Failure to do extra credit will never be counted against you. You should do extra credit work if you find it interesting and think that it might teach you something. It never pays to skimp on the regular assignments in order to do extra credit problems.

If you get a 30 on a lab assignment and also 5 points of extra credit, that is not the same as getting a 35 with no extra credit. The latter is far better.

How to get help

There are many ways for you to get help. Your first step should be to ask a question on Ed Discussion. You will find the link to it on Canvas. You can visit me or course staff during office hours, or you can make an appointment with me or a TA or your section leader.

Honor principle

On exams, all work must be your own. For your assignments, you may consult freely with instructor, TAs and classmates during the phase of designing solutions, but you should then work individually when creating your programs—typing, documenting, and generating output. During the debugging stage you may discuss your problems with others in the class, but you should not copy code to “fix” bugs. To do otherwise is a violation of the Academic Honor Principle. If you work with a classmate on any assignment, you should tell us who you worked with in a comment at the beginning of your program. Please note that you can work with a classmate only during the designing stage.
You should attribute the proper source in any code that you submit that you did not write yourself. This includes code that you take from outside references – for example a book other than the course text. And it even includes code that you take from class examples, a book, or the assignments. (I agree that may be tedious to attribute the source in code that we have given you, but we want you to be in the habit of attributing your sources.)

It is a violation of the Academic Honor Principle to falsely represent output as coming from your program if it did not. If you change your program, make sure to generate output from the version of the program that you hand in.

Over the years we have developed and refined a number of homework problems, and I plan to reuse some of them for this class. You should not look at any solutions to homeworks assigned in previous terms, including sample solutions, or solutions written by other students.

We have had some uncomfortable situations occur in the past. Two students, Alice and Ralph, discuss an assignment and design their code together. That is fine. But then they decide that since their programs would be so similar, they might as well have Alice type in the code, have Ralph make his own copy of the file containing the code, and then have Ralph make his own minor changes. This is a violation of the Academic Honor Principle. Although you may discuss and design with others, the code you hand in must be entirely your own.

Here’s another situation that occurred. Trixie and Ed start working independently on a program. Trixie finishes and has a working version. Ed has trouble with his. Trixie helps Ed debug. That is fine. But then Trixie realizes that Ed has a section of code that is all wrong and the program she wrote has just the right code for that section. She shows Ed her program. Or worse, she gives Ed an electronic copy of her program so that he can just paste in the correct code. Either action is a violation of the Academic Honor Principle.

Here is a good rule of thumb. If you are talking in normal English (or Chinese or German or some other natural language) you are probably OK. If you find yourself talking in Python code, you have crossed the line. So saying, “Your program runs forever because you have the wrong condition in the while loop” is OK. But saying, “Change while x == 0: to while x >= 0:” is not.

All assignments are individual assignments and students are not allowed to collaborate to solve the solutions.

If you have any question about whether what you’re doing is within the Academic Honor Principle, ask me! If it’s late and you can’t find me, you’re better off erring on the side of caution.

Most violations of the Academic Honor Principle come down to failure to cite work that is not yours. If you copy any portion of your program from your friend Elvira and represent it as your work, then you either intended to deceive or were careless about citing. Either case is a violation of the Academic Honor Principle. If you copy your entire program from Elvira but include the comment, “This code was copied in its entirety from Elvira,” then you cited properly, though you didn’t actually do the work. In this latter case, I would not report a violation of the Academic Honor Principle, though your grade on the assignment would be 0. But that would be far preferable to a Committee on Standards COS hearing.

The same goes for code that you find in some other book or on the Internet. You are in violation of the Academic Honor Principle if you fail to attribute your sources.

You don’t need to cite just because you’re using a construct you saw elsewhere. For example, you need not cite for using print("something"), even though it was in the class examples. That would be like citing “printing press” in an essay! Nor do you have to cite just because you use a while-loop, even though you saw a while-loop in a class example. It’s when you lift several lines of code from elsewhere that you need to cite.

To cite, include in a comment—near the top of your file is fine—stating where you got the code from:

# Based on the say_introduction function in chapter 1 of the course notes.

Special note for when you work on a computer that anyone else might use

If you are working on a computer that someone else in the course might use, you should be very careful to remove your code from the computer when you are all done. You should probably email your code to yourself before you remove the code.

If you leave your code on a computer, and someone else can see it, then they can copy it and hand it in. It’s often difficult to tell who was the copy-ee and who was the copy-er. Avoid this situation.

To remove your code, you’ll want to delete it from the PyCharm workspace. And you’ll also want to move any other copies on the computer to the Trash (or the Recycling Bin) and empty it.

You can more details on Dartmouth Honor Principle here

Special note on code generators

There is an increasing number of AI applications, such as ChatGPT, Copilot, Kite and Bard, that can automatically generate assignments and labs for CS1. However, it is a violation of the honor code to submit any code generated by these tools as your own.

We strongly advise against using code generators in this class and encourage you to learn to code without their assistance. The reason for this is that you will become a better programmer if you learn the tried and tested way of writing and debugging your own code.

We state that we “encourage” you to learn to code without code generators. Although we use the word encourage, please be aware that dropping practice problems into ChatGPT will likely result in poor test, midterm and final scores. Additionally, code generators use optimizations and esoteric techniques that we do not teach in this class, and using these optimizations in assignments or exams will result in a zero grade for that problem.

To clarify, if you include code from a code generator, it is an honor code violation. If you include a code optimization from code generators you will receive zero on the problem. These are two distinct cases you should understand well. If you are unsure of what to do, please err on the side of caution and only use techniques taught in class or in our textbook. Please be very careful and do not use techniques learned from code generators, as this will not help you in the course and may lead to disappointing grades.

What happens if you violate the academic honor principle?

The Committee on Standards (COS) is responsible for addressing any instances of Academic Honor Principle violations in CS1. Unfortunately, every year, a number of students breach this principle. Faculty members are required to report any suspected violation to the COS for consideration. The COS then deliberates and makes a determination. Students who have violated the honor principle by the COS have received a failing grade in CS1 and faced multiple-term suspension from the college. It is important to remember that CS1 is a course designed to teach programming skills, not to impose penalties or assign grades. Thus, we urge all students to uphold the honor principle and avoid any actions that may violate it.

One 48 hour regret period per term

The regret period aims to help students who may experience panic and submit assignments that violate the honor code due to various factors such as academic workload, social events, stress, lack of sleep, or other personal circumstances. It acknowledges that students may make mistakes in the pursuit of their academic goals, and provides an opportunity for them to reflect on their actions and take responsibility for their mistakes.

Under the regret clause, if a student realizes that they have violated the honor code, they can contact Andrew Campbell via email within 48 hours of the submission with the subject line “On Reflection”. In doing so, the student acknowledges their mistake and takes the first step towards making amends. The student will receive a grade of zero for the assignment, which serves as a penalty for the violation. However, no additional consequences will occur unless the student repeats the same mistake.

This policy aims to create a safe and supportive environment for students to learn and grow. By encouraging students to take responsibility for their actions and providing a second chance, it promotes academic integrity and helps maintain the college’s high standards.

Religious observances

Some students may wish to take part in religious observances that occur during this academic term. If you have a religious observance that conflicts with your participation in the course, please meet with me before the end of the second week of the term to discuss appropriate accommodations.

Student accessibility and accommodations

Students requesting disability-related accommodations and services for this course are encouraged to schedule a phone/Zoom meeting with me as early in the term as possible. This conversation will help to establish what supports are built into my course. In order for accommodations to be authorized, students are required to consult with Student Accessibility Services (SAS; Getting Started with SAS webpage; student.accessibility.services@dartmouth.edu; 603-646-9900) and to request an accommodation email be sent to me. We will then work together with SAS if accommodations need to be modified based on the learning environment. If students have questions about whether they are eligible for accommodations, they should contact the SAS office. All inquiries and discussions will remain confidential.

Mental health and awareness

The academic environment at Dartmouth is challenging, our terms are intensive, and classes are not the only demanding part of your life. There are a number of resources available to you on campus to support your wellness, including your undergraduate dean, Counseling and Human Development, and the Student Wellness Center. I encourage you to use these resources to take care of yourself throughout the term, and to come speak to me if you experience any difficulties.

Title IX

At Dartmouth, we value integrity, responsibility, and respect for the rights and interests of others, all central to our Principles of Community. We are dedicated to establishing and maintaining a safe and inclusive campus where all have equal access to the educational and employment opportunities Dartmouth offers. We strive to promote an environment of sexual respect, safety, and well-being. In its policies and standards, Dartmouth demonstrates unequivocally that sexual assault, gender-based harassment, domestic violence, dating violence, and stalking are not tolerated in our community.

The Sexual Respect Website at Dartmouth provides a wealth of information on your rights with regard to sexual respect and resources that are available to all in our community.

Please note that, as a faculty member, I am obligated to share disclosures regarding conduct under Title IX with Dartmouth’s Title IX Coordinator. Confidential resources are also available, and include licensed medical or counseling professionals (e.g., a licensed psychologist), staff members of organizations recognized as rape crisis centers under state law (such as WISE), and ordained clergy see.

Should you have any questions, please feel free to contact Dartmouth’s Title IX Coordinator or the Deputy Title IX Coordinator for the Guarini School. Their contact information can be found on the sexual respect website at: https://sexual-respect.dartmouth.edu.

Important advice

Read the material I ask you to read. Start all assignments early. With few exceptions, at the time you receive an assignment, you’ll know everything you need to do it.

Do not be afraid to get help. The purpose of this course is not to waste your time. If you are not making progress on a problem, please see me, a TA, or a section leader.

Three final pieces of advice:

  1. Don’t fall behind in this course.
  2. Don’t fall behind in this course.

The material in CS 1 builds on itself, and the pace is fast. As a result, it’s easy to fall behind in this course, and if you do it’s very difficult to recover.


This version of the course is based on the course designed by Prof. Kommineni, Prof. Balkcom, Prof. Cormen, Prof. Farid, Prof. Jayanti. I am thankful to them for the wonderful material they have developed.