COGS 18: Introduction to Python#

Fall 2022
MWF 8-8:50 (Peterson Hall 110)


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 and writing 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 STAFF & INFORMATION#

What

Who

When

Where

Lecture

MWF 8-8:50AM

Peterson Hall 110
and on Zoom simultaneously

Coding Lab

Shivani

Wed 9 AM-9:50 AM
Wed 10 AM-10:50 AM
Wed 11 AM-11:50 AM

CSB 115

Pooja

Wed 12 PM-12:50 PM
Wed 1 PM-1:50 PM
Wed 2 PM-2:50 PM

CSB 115

Zoe

Wed 3 PM-3:50 PM
Wed 4 PM-4:50 PM
Wed 5 PM-5:50 PM

CSB 115

Office Hours

Prof Fleischer

Signup for office hours

Using the link you can pick time slots for
either in person (CSB 257) or Zoom

Pooja

Mon 6-7 pm (tentative)

https://ucsd.zoom.us/j/6400500021

Shad

Mon 12-1PM

CSB 114
or https://ucsd.zoom.us/my/shadreyes

Shivani

Mon 12-1PM

https://ucsd.zoom.us/j/93922231856

Irisa

TuTh 1-2PM

Email me with your preferred time and location (irjin@ucsd.edu)

Jose

Fri 5-6pm

https://ucsd.zoom.us/j/91250676908

Trista

Mon 4-4:30pm
Tue 3:30-4:30pm

Please sign up here for OH
Zoom link for OH

Zoe

week 1: Thur 4:30-6:30pm; starting week2: Tue 4:30-6:30pm

https://ucsd.zoom.us/j/7256308261

Jeff

Friday 12PM-1PM

CSB 114

Course Website: https://cogs18.github.io
Canvas Course: https://canvas.ucsd.edu/courses/40702
Course Piazza*: https://piazza.com/class/l84mqraemi03p0 (login code on Canvas)
Assignment Submission: https://datahub.ucsd.edu
Course Feedback (anonymous): Google Form

*You will be able to post anonymously on Piazza; 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, information will be presented during lecture. You will have the opportunity to program in lecture, during coding 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 the course website and datahub

    • Software (optional): Python >=3.6 (Anaconda distribution); Jupyter Notebooks (this will be available on datahub)

    • iclickers will be used but not reequired this quarter

    • No required textbook; optional textbook: https://shanellis.github.io/pythonbook (currently under development; feedback welcome)

Detailed instruction for software installations/access will be listed on the course website and provided across week 1 coding labs. All of the software is freely-available for download.

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

Requirement

Assignments

40%

Complete 5 Assignments

Midterms

25%

Complete 2 Exams

Coding Lab

16%

Participate in 8 Coding Labs

Final Project

19%

Complete Final Project OR Final Exam

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+ (final project) / A (final exam)

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

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, post privately on Piazza to “Instructors & TAs” using the “regrades” tag within 72 hours. This post should include evidence of 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. It would be an unfair burden to place on TAs if we didn’t have this policy.

Attendance#

Attendance will not be recorder nor incentivized this quarter, given that we are (still) mid-transition in our return to in-person learning, and I do not want to encourage anyone to come to class if they’re not feeling well. This applies to lecture as well as coding lab.

Lecture#

Students are encouraged to attend lecture live (either via zoom or in person); however, all lectures will also be recorded/podcast. During lecture, students will be given time to complete small coding challenges on their own, and will have the opportunity to see their classmates thoughts during lecture.

There will be a daily participation survey (link on Canvas) to provide feedback and ask questions about each lecture. Each time you fill out the lecture survey, you get a small % of credit toward your final project/exam. Completion of all surveys can provide up to 3.5% extra credit on your final project/exam (not your final course grade). Each day’s survey will be up for at least three days and can be completed regardless of whether you attend class live or watch the recording.

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 tutorials or activities each week that are focused on preparing you for the assignments. Across the quarter there will be 9 different coding labs (2% each; lowest coding lab score dropped). Coding labs are graded for concerted effort (not correctness). To receive credit for a coding lab, you have to submit your attempted coding lab for that week by Wednesday at 11:59 PM each week. There are no late submissions for coding labs.

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.

Assignments (40%)#

There will be five assignments, each worth 8% of your final grade. Assignments will be hands-on coding assignments. Assignments are to be completed individually and submitted on datahub. 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 at 75% credit for 72 hours (3 days) after the assignment’s due date. Once the late deadline passes, assignments will be graded, feedback will be made available on datahub, and assignments will no longer be able to be submitted for credit.

You are permitted to work with classmates on assignments; however, 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 may not post full assignments nor any part of any assignment on the Internet (i.e. Chegg or related site). Evidence of cheating on an assignment will result (at minimum) in loss of a full letter grade in the course.

Midterms (25%)#

There will be two (2) midterms. All midterms will be take-home exams. You will have at least 24 hours to complete each exam. The exam will be open-notes and open-Google; however, it will have to be completed individually. Students will not be permitted to discuss the questions on the exam with anyone.

Each midterm is worth 12.5% of your grade. The exams will include varied question types, will be taken online, and will be due at 11:59 PM on the day of the assigned midterm.

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. 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::

Final Project OR Exam (19%)#

Students will choose whether they complete the final project OR the final exam, worth 19% of your final grade Students get to choose which option is best for them but may only submit one and there are three limitations of choosing the final exam 1) There is no opportunity for extra credit on the final exam, 2) you cannot get help from anyone else while taking the final exam, and 3) the highest grade you can get if you choose the exam is an A. (To earn an A+, you must do the final project.)

Final Project You will learn more from the final project than you will from the final exam, but the project is more time-consuming and involved. We will discuss the details elsewhere; however, briefly, you will either (1) expand upon one of the class assignments adding original elements or (2) write original code for a project topic of your choosing. The goal of this project is to demonstrate that you can write good, well-documented code that solves the problem you’ve set out to solve.

Final Exam The final exam will be take-home and you will have at least 48 hours to complete the exam. It will be the completion of a guided, mini-project, focusing on the material learned in the last third of the course. Additional details will be discussed in class.


COURSE SCHEDULE#

Week

Day

Topic

Section covers

Lab due

Assignment due

Exam

9/23/2022

0

F

Welcome!

9/26/2022

1

M

Introduction

9/28/2022

1

W

Tooling

CL1

CL1

9/30/2022

1

F

Variables

10/3/2022

2

M

Operators I

10/5/2022

2

W

Operators II

CL2

CL2

10/7/2022

2

F

Functions

10/10/2022

3

M

Conditionals I

Checkpoint

10/12/2022

3

W

Conditionals II

CL3

CL3

10/14/2022

3

F

Collections

A1

10/17/2022

4

M

Debugging *

10/19/2022

4

W

Review

CL4

CL4

10/21/2022

4

F

Loops

E1

10/24/2022

5

M

Loops II

Checkpoint

10/26/2022

5

W

Algorithms (possible to add ii?)

CL5

CL5

10/28/2022

5

F

Methods

A2

10/31/2022

6

M

Classes I

Checkpoint

11/2/2022

6

W

Classes II

CL6

CL6

11/4/2022

6

F

Classes III **

A3

11/7/2022

7

M

Python Party

11/9/2022

7

W

Review

CL7

CL7

11/11/2022

7

F

No class - Veterans day

E2

11/14/2022

8

M

Command Line

Checkpoint

11/16/2022

8

W

Modules & Scripts

CL8

CL8

11/18/2022

8

F

Scientific Computing

A4

11/21/2022

9

M

Code Style

11/23/2022

9

W

Documentation

CL9

CL9

11/25/2022

9

F

No class - Thanksgiving

11/28/2022

10

M

Code Testing

Checkpoint

11/30/2022

10

W

Code Projects

Projects

12/2/2022

10

F

Wrap Up

A5

12/5/2022

Finals

M

Final exam

12/7/2022

Finals

W

Final project

Final Exam/Project: Final Projects/Exams (you’ll chose one) are due on the date of the scheduled final exam (Mon 3/14) by 11:59 PM. You do not have to show up anywhere at the scheduled date/time of the final.

Notes:
[*] denotes the last day of material covered on Midterm I (E1).
[**] the last day for material on Midterm II (E2).


OTHER GOOD STUFF#

Piazza Rules#

Piazza is an incredible 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 Piazza:

  1. Before posting your question, look at questions that have already been posted to avoid duplicates.

  2. 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)

  3. 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 (to “Instructors & TAs” only) on Piazza.

  4. 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.

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 Prof. Ellis, 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 contact Professor Ellis by emailing your assignment (sellis@ucsd.edu), or else it will be graded as late.

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 make arrangements to contact Professor Ellis 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

How to Get Your Question(s) Answered and/or Provide Feedback#

It’s great that we have so many ways to communicate, but it can get tricky to figure out who to contact or where your question belongs or when to expect a response. These guidelines are to help you get your question answered as quickly as possible and to ensure that we’re able to get to everyone’s questions.

That said, to ensure that we’re respecting their time, TAs and IAs have been instructed they’re only obligated to answer questions between normal working hours (M-F 9AM-5PM). Professor Ellis is also going to do her best to stick to these working hours and only go on Piazza MWF each week. However, I know that’s not when you may be doing your work. So, please feel free to post whenever is best for you while knowing that if you post late at night or on a weekend, you may not get a response until the next weekday. As such, do your best not to wait until the last minute to ask a question.

If you have:

  • questions about course content - these are awesome! We want everyone to see them and have their questions answered too, so post these to Piazza!

  • a technical assignment question - come to office hours (or post to Piazza). Answering technical questions is often best accomplished ‘in person’ where we can discuss the question and talk through ideas. However, if that is not possible, post your question to Piazza. Be as specific as you can in the question you ask. And, for those answering, help your classmates as much as you can without just giving the answer. Help guide them, point them in a direction, provide pseudo code, but do not provide code that answers assignment questions.

  • been stuck on something for a while (>30min) and aren’t even really sure where to start - Programming can be frustrating and it may not always be obvious what is going wrong or why something isn’t working. That’s OK - we’ve all been there! IF you are stuck, you can and should reach out for help, even if you aren’t exactly sure what your specific question is. To determine when to reach out, consider the 2-hour rule. This rule states that if you are stuck, work on that problem for an hour. Then, take a 30 minute break and do something else. When you come back after your break, try for another 30 minutes or so to solve your problem. If you are still completely stuck, stop and contact us (office hours, post on Piazza). If you don’t have a specific question, include the information you have (what you’re stuck on, the code you’ve been trying that hasn’t been happening, and/or the error messages you’ve been getting).

  • questions about course logistics - first, check the syllabus. If you can’t find the answer there, first ask a classmate. If still unsure, post on Piazza.

  • questions about a grade - Post on Piazza with “regrades” tag in a private post to “Instructors & TAs”.

  • something super cool to share related to class or want to talk about a topic in further depth - feel free to email Professor Ellis (sellis@ucsd.edu) or come to office hours. Be sure to include COGS18 in the email subject line and your full name in your message.

  • 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 Professor or Professor Fleischer or Dr. Fleischer. I’m also perfectly happy if you call me Jason, but not all professors are OK with that kind of informality. I would prefer you not address me as Mr. Fleischer; if you’re going to use an honorific please use the one that people expect in the situation.

What I should call you#

I should call you by your preferred name, with the correct pronunciation and any honorific or pronouns you choose. Please correct me (either in the chat, out loud on zoom, or via email/Piazza after the fact…however you’re most comfortable) if I ever make a mistake.