SYLLABUS#
Introduction to Python | Spring 2025
v.0.0.3 (Apr 1)
COURSE OVERVIEW#
Welcome to COGS 18! The core goal of this class is to teach you introductory, hands-on skills for computer programming, specifically using the Python programming language. We aim to do so in a way that fits well within the cognitive science department, using particularly-relevant use cases. Our approach is to focus on programming as a tool and to get you started with the necessary background and basic skills required to get you reading, writing, and debugging code. We aim to provide you with a strong foundation so that you can continue programming after you leave this class, applying the skills you learn here to your domain or topic of interest.
COURSE INFORMATION#
Lecture: TuTh at 11-12:20 (PETER 110) OR 2-3:20 (CTL 0125)
Labs: on the hour 9-5 Wed and Fri (CSB 115)
Office Hours Times/Locations, Coding Lab Staff, and Staff pictures can be found on Canvas.
Important Links
Q&A (Ed)* - for join link, see Canvas
*You will be able to post anonymously; however, you will only be anonymous to your classmates. The instructional staff will be able to see who you are.
COURSE OBJECTIVES#
Our main goal is that you are able to program at an introductory level in the Python programming language at the end of this course. To that end we expect that you will be able to:
Read basic Python programs, recognizing the structures used (i.e. variables, conditionals, loops, functions) and explaining how they work
Write Python code to solve basic computational problems
Debug small Python programs by identifying and fixing the bug(s)
Execute Python programs in Jupyter notebooks and from Python scripts
Demonstrate familiarity with the command line
Describe and implement best practices (code style, documentation, and testing) in Python
To achieve these objectives, students will watch short videos before each lecture and take a short quiz on the information in the videos. Class time will be dedicated to deepening understanding of core topics with a lot of learning by doing. You will have the opportunity to program in lecture, during lab, and throughout all assignments. Examples throughout this course will be related to cognitive science, focusing on data analysis, artificial intelligence, human-computer interaction, and programmatic thinking.
COURSE MATERIALS#
All materials will be provided via:
course textbook [no cost]
Note: If you do not have consistent access to the technology needed, please use the form below to request a loaner laptop: https://eforms.ucsd.edu/view.php?id=490887. (For any issues that you may have, please email vcsa@ucsd.edu and they will work to assist you.)
GRADING & ATTENDANCE#
Grading:
% of Grade |
# to complete |
|
---|---|---|
Surveys |
4% |
Complete pre- and post-surveys |
Video Quizzes |
12% |
12 (1% each) |
Coding Lab |
16% |
8 (2% each) |
Assignments |
25% |
5 (5% each) |
Oral Exams |
5% |
2 (2.5% each) |
Midterms |
24% |
2 (12% each) |
Final |
14% |
1 |
Grades#
All grades will be released on Canvas. It is your responsibility to check that your assignment was submitted, that your grade is accurate, and to get in touch if any are missing and/or you think there is a problem.
To calculate final grades, I use the standard grading scale and do not round grades up (given the numerous extra credit opportunities offered):
Percentage |
Letter Grade |
---|---|
97-100% |
A+ |
93-96% |
A |
90-92% |
A- |
87-89% |
B+ |
83-86% |
B |
80-82% |
B- |
77-79% |
C+ |
73-76% |
C |
70-72% |
C- |
67-69% |
D+ |
63-66% |
D |
60-62% |
D- |
<60% |
F |
The “I already know Python” Grading Policy#
If you have to take this course to fulfill a requirement but are already very familiar with the course content, there is an option for you! I’m interested in student learning, not busy work, so if you already know the material, let’s save you some time. Students who choose this option only have to complete the pre- and post-surveys, two oral exams, two midterms, and the final exam. The surveys will still be 4% of your grade. Each oral exam will down for 5% of your final grade; each midterm will count for 25% of your final grade and the final will count for 36% of your final grade. Students may opt-into this at any time during the quarter up until the due date of the final by filling out this form; however, once you opt in you cannot change your mind. For example, if you decide in week 4 that you want to opt-in and then bomb the first exam, you cannot change your mind in week 6, as you would then be behind, would have missed some deadlines, and dealing with this logistical nightmare would not be fair to course staff. That said, if you’re on the fence, I’d encourage you to complete the course as designed until you’re certain you want to go this route.
Assignment Regrades#
We will work hard to grade everyone fairly and return assignments quickly. And, we know you also work hard and want you to receive the grade you’ve earned. Occasionally, grading mistakes do happen, and it’s important to us to correct them. If you think there is a mistake in your grade on an assignment, create an issue on the assessment on PrairieLearn explaining why you think your answer was correct and should point to the specific part of the assignment in question.
Note that points will not be rewarded if you fail to follow instructions. For example, if the instructions say to name the variable orange
and you name it ornage
(misspelled), you will not be rewarded credit upon regrade. This is because (1) following instructions and being detail-oriented is important and (2) there are hundreds of students taking the course this quarter.
In-person illness policy#
Please do not attend any in-person activity (lecture/coding lab/office hours) if you are feeling ill, especially if you are sneezing/coughing and have a fever. If you feel mildly ill but without sneezing/coughing, or if you have allergies or similar, then you may come to in-person events while wearing a well-fitting mask.
Lecture#
Students are encouraged to attend lecture live; however, in-person attendance is not required. All lectures will be podcast. However, during lecture, students will be given time to complete small coding challenges on their own, complete activities in pair/ssmall groups, and will have the opportunity to see their classmates’ thoughts during lecture. If this is your first time learning to code, please prioritize coming to class.
To incentivize attendance, we will use Google Forms for in-class Q&A and activities. Students will receive a small amount of extra credit for each lecture attended, up to 2% extra credit (for those who attend every lecture) on their final grade. To earn credit in a given day, students must complete at least 50% of the Google Forms submitted on that day (correctness does not matter). Students are free to attend either lecture time.
Pre- and Post-Assessment Surveys (4%)#
Students will be required to complete two pre-course assessment surveys (2%) as well as a post-course assessment survey (2%). These will be used to learn a bit more about you as a student as well as your knowledge in Python. (Note: you are NOT expected to have any Python knowledge at the start of the course.) Completion of these surveys is required in COGS 18; however, students will choose whether their responses can be used for future research. Students will earn credit for completion and are not graded on correctness.
Video Quizzes (12%)#
On Mondays and Wednesdays (the night before most lectures), there will typically be a video quiz due. Each video quiz will comprise of questions from the previous lecture and questions from the assigned reading/watching from the textbook. Students are expected to watch the videos in the textbook from the assigned reading, read the content, and then take the quiz on PrairieLearn to check their understanding. Students are encouraged to bring questions to class for parts of the reading/videos that they did not understand. Video quizzes will be accepted up to 48h late for a 25% penalty.
Coding Labs (16%)#
Lab times will be used to get hands-on practice with the course material in a smaller group setting. As such, you will be provided with specific activities each week that are focused on preparing you for the assignments. Across the quarter there will be 8 different coding labs (2% each). Coding labs are graded for correctness; however, students will have unlimited attempts for each question and the ability to earn full marks regardless of number of attempts. To receive credit for a coding lab, you have to complete your coding lab for that week by Friday at 11:59 pm each week. Labs will be accepted up to 48h late, for a 25% penalty.
Note: You should be signed up for the Coding Lab for which you can attend. However, if you are unable to attend the Coding Lab for which you are signed up, you are free to attend the other Coding Lab in a given week. Note that this policy could change if too many people are attending one Coding Lab each week. We intentionally have Coding Lab capped at 35 so that students can get help from their TAs and IAs during this time.
Oral Exams (5%)#
Each student will also have to sign up for two oral exam slots during the quarter (2.5% each), one in weeks 3-6 and another in weeks 7-10. These will take place during coding labs and each oral exam slot will be 5 min. Students will be asked a few questions by an instructional staff member about the material covered up to that point and will be graded on their understanding of core concepts and their ability to explain code.
Assignments (25%)#
There will be five assignments, each worth 5% of your final grade. Assignments will be hands-on coding assignments. You will typically have about 1 week after release to complete each assignment. Assignments will be due at 11:59 PM on the assigned date.
Late assignments will be accepted for a 25% credit for 48 hours (2 days) after the assignment’s due date.
You are personally responsible for understanding everything you turn in. While you may ask one another about assignments, you may not copy directly from a classmate and you must understand and be able to explain everything you submit. You may not post full assignments nor any part of any assignment on the Internet (i.e. Chegg, Discord, or related site). Evidence of cheating on an assignment will result (at minimum) in loss of a full letter grade in the course.
Exams (38%)#
There will be two (2) midterms (12% each) and a final exam (14%). Each exam will be closed-notes and taken at the Triton Testing Center Computer-Based Testing Facility (TTC-CBTF) in AP&M B349. Each midterm will be 45 minutes. The final exam will be 110 minutes. For all exams, students will have to sign up for an exam slot. For the first midterm, students will be able to sign up for a slot during week 5 (4/28-5/3). For the second midterm, students will be able to sign up for a slot across weeks 8 and 9 (5/23-5/30). For the final, all students will have to sign up for a slot during finals week (6/7-6/13). Please note that this final exam date/time will likely differ from what you see in WebReg. Students MUST bring their physical ID to take their exams.
Students will also have the opportunity to retake either the first or second midterm across weeks 9 and 10 (5/31-6/6). To be eligible for a retest, you have to have made a first attempt during the originally-scheduled exam time. For any exams that are re-taken, the students’ grade will be comprised of 25% of the attempt with the lower score and 75% of the attempt with the higher score. For example, if you score a 6/12 on an exam and retake that exam and score an 11/12 your recorded grade would be a 9.75 (0.256 + 0.7511).
You must schedule your tests at least three days in advance, but it is recommended that you do so as soon as possible. To schedule, visit prairietest.com and login with your UC San Diego credentials. Reservations can be changed until 10 minutes before the test begins. More information about testing policies and procedures can be found on the TTC’s website. You may also email tritontesting@ucsd.edu for assistance.
Please note that if you plan to use OSD-approved accommodations for your test, you will take it at the TTC’s Pepper Canyon Hall location. You must schedule your test three days in advance through the RegisterBlast system.
As former students know, I take academic integrity seriously, but I also trust most students to do the right thing. I would rather spend more time teaching and less time ensuring that there is no way for students to cheat because let’s be honest…there’s always a way to cheat (and always a chance if you cheat you’ll get caught). I trust and am confident that the vast majority of students care about their education enough to take this seriously and am unwilling to spend all my energy focused on those students who do not. That said, students should anticipate that if they are caught cheating on an exam, they will fail the class. ::steps off soapbox::
Extra Support#
We are trying to be proactive this quarter about supporting all students. To this end, we recognize that some students want/need more time with the course material. To this end, there will be dedicated review sessions and office hours specifically designed for students who may benefit from this additional support. While these sessions will be open to all students, we will be individually reaching out to students who we think may benefit throughout the quarter. Attendance is optional, but for those who want it, we’re hoping this is a community where everyone can really learn the material well.
OTHER GOOD STUFF#
Ed Rules#
Ed is a great resource for technical classes. It gives you a place to post questions and an opportunity to answer others’ questions. We do our very best as an instructional staff to answer each and every question in a timely manner. We also want to make sure this platform is being used to learn and not thwarting anyone’s education. To make all of this possible, there are a few rules for this course’s Ed:
Before posting your question, look at/search questions that have already been posted to avoid duplicates.
If posting about an assignment, note title should have assignment number, question number, and 1-2 words about the question. (i.e. A1 Q1 Variable Naming)
Never post an answer to or code for an assignment on a public post. Pseudocode is encouraged for public posts. If you must include code for an assignment, make this post private.
Your post must include not only your question/where you’re stuck, but also what you’ve already done to try to solve it so far and what resources (class notes, online URLs, etc.) you used to try to answer the question up to this point.
How to Get Your Question(s) Answered and/or Provide Feedback#
The best place for class questions is Ed. This is where you have about 20 people (Prof, TAs, IAs) who can answer your question and you’re likely to get a response the fastest.
If you have a very specific question that you think only Professor Ellis can address, feel free to email (sellis@ucsd.edu), but please do include [COGS 18] in the subject line.
Finally, if you have some feedback about the course you want to share anonymously (If you’ve been offended by an example in class, really liked or disliked a lesson, or wish there were something covered in class that wasn’t but would rather not share this publicly, etc.) please fill out the anonymous Google Form*
*This form can be taken down at any time if it’s not being used for its intended purpose; however, you all will be notified should that happen.
What should you call me?#
Most students call me Prof/Professor Ellis. I’m also perfectly happy if you call me Shannon (not all professors are OK with that kind of informality) or Dr. Ellis. I would prefer you not address me as Ms/Miss/Mrs. Ellis.
What should I call you?#
I should call you by your preferred name, with the correct pronunciation. Please correct me (out loud in the moment, via email/Ed after the fact, or however you’re most comfortable) if I ever make a mistake.
What should you expect of your interactions with instructional staff?#
Interactions with instructional staff (professor, TAs, IAs) will be:
Dialog-based: We will use dialog-based teaching rather than monologues. When students have questions that require a lengthy explanation of a concept that was covered in lecture, we will refer you to an external resource (e.g. lecture, site, video) for you to look at first. Of course, if you have questions about what you learn in those resources, please ask us! We want to make sure that everyone has done the preliminary background work so that we are using our time most effectively.
Student-driven: Rather than tell you how to solve a problem, we aim to ask you questions and point you toward illustrative examples to help lead you toward finding a solution on your own.
Example-heavy: We will ask you about previous example problems you may have seen in lab or lecture that might be helpful to the problem at hand. When you look through examples you’ve seen, you might be able to find one that’s relevant to your problem and use it as inspiration for a solution. Also, when we know which examples you’ve seen and which ones you understand or don’t, we can better pinpoint where your confusion lies.
Scaffolded with prior knowledge: If you’re lacking prerequisite knowledge needed for the question you’re asking, we take a step back and cover that before returning to the problem.
Class Conduct#
In all interactions in this class, you are expected to be respectful. This includes following the UC San Diego principles of community.
This class will be a welcoming, inclusive, and harassment-free experience for everyone, regardless of gender, gender identity and expression, age, sexual orientation, disability, physical appearance, body size, race, ethnicity, religion (or lack thereof), political beliefs/leanings, or technology choices.
At all times, you should be considerate and respectful. Always refrain from demeaning, discriminatory, or harassing behavior and speech. Last of all, take care of each other.
If you have a concern, please speak with the professor, your TAs, or IAs. If you are uncomfortable doing so, that’s OK! The OPHD (Office for the Prevention of Sexual Harassment and Discrimination) and CARE (confidential advocacy and education office for sexual violence and gender-based violence) are wonderful resources on campus.
Academic Integrity#
Don’t cheat.
You are encouraged to work together and help one another. However, you are personally responsible for the work you submit. For assignments, it is your responsibility to ensure you understand everything you’ve submitted and to make sure the correct file has been submitted and that the submission is uncorrupted. Please review academic integrity policies here.
Cheating and plagiarism have been and will be strongly penalized. If, for whatever reason, Canvas or DataHub is down or something else prohibits you from being able to turn in an assignment on time, immediately email the professor or else it will be graded as late.
Policy on using Artificial Intelligence programming assistance#
I believe that using large language models (LLMs) or other kinds of AIs can help a good programmer work more efficiently. I also believe that relying on AI assistance will probably slow down the development of a beginning programmer into a good programmer.
My advice: if you struggle to conceptualize how you want to write a program you should probably NOT use an LLM (or at least not right away). The beginning or intermediate programmer needs to practice their craft…just like you will never get to be great at a video game by just watching other people’s speed runs. I think it’s fine to use AI assistance if you can immediately imagine how to solve the problem but you just want help with implementation details, to see alternative algorithms you could use, or help writing it faster.
Note that LLMs are most helpful in learning when you determine the questions to ask it and interpret the answer, NOT when you copy+paste questions from assignments in directly and then copy+paste the answer it spits out. For example, if a question in this class asked you to “write a function that takes two parameters income
, tax_rate
that will calculate how much you owe in taxes”, you would NOT just copy that question into ChatGPT/CoPilot/etc. Instead, you would attempt the question on your own and then ask specific questions on parts of the question you don’t understand. For example, you may ask the LLM, “what does it mean for a function to take two parameters?” This way you ensure you’re understanding and maximizing learning. (Also, note that example question was intentionally not detailed enough to actually get you a “right” answer for such a question but to serve as an example for what it means to ask your “own” questions.)
You can use AI to help you program as long as you:
make a code comment that cites the AI used, and provides an estimate of how much code in a given block is machine generated. For instance you might write this
# The (code/design) of this function is (completely/mostly/partially) generated by Github Copilot from the prompt "write a python function to bubble sort a list"
Feel free to include a description of any specific changes you made from the machine generated code… it was edited to reduce execution time, to deal with edge cases, to deal with an empty data file, etc..don’t assume LLM code is working and just hand in without checking. You are always responsible for functionality and understanding how something works.
understand that programming with LLMs still requires you to do programming. But instead of creating code from scratch (the part many people enjoy) you will need to do debugging and unit testing (the part many people don’t like)
you understand that you may be asked to explain your code at any time. A helpful heuristic can be to ask yourself “Can I explain each piece of code and each analysis carried out in what I’m submitting? Could I reproduce this code/analysis on my own?”; you should be able to answer “Yes” to both questions for everything you submit in this course. If you can’t explain how your code works and why the design is that way, you may lose points.
To help guide your learning, we will demonstrate and explicitly teach learning with an LLM. However, you will not have access to an LLM for exams, so we will be very clear about what we expect you to know/be able to do without an LLM and when it’s OK to rely more heavily on LLM access.
Disability Access#
Students requesting accommodations due to a disability must provide a current Authorization for Accommodation (AFA) letter. These letters are issued by the Office for Students with Disabilities (OSD), which is located in University Center 202 behind Center Hall. Please contact the professor privately to arrange accommodations.
Contacting the OSD can help you further:
858.534.4382 (phone)
osd@ucsd.edu (email)
http://disabilities.ucsd.edu
Difficult Life Situations#
Sometimes life outside of academia can be difficult. Please email me or come to office hours if stuff outside the classroom prevents you from doing well inside it. I can often refer you on to the help you need.
If you don’t have the most essential resources required to thrive as a student, please contact UCSD Basic Needs who can help you access nutritious food and stable housing, and help you seek the means to reach financial wellness.
If you need emergency food, finances, and/or academic and social support you can also contact UCSD Mutual Aid. They provide mentoring and aid that comes from volunteers among your peers. If you don’t need that kind of support, consider joining them in helping your fellow classmates who do.
If you need counseling or if you are in a mental crisis you can contact CAPS. They provide psychiatric services, workshops, and counseling; they also operate a 24/7 crisis hotline at 858.534.3755.