Skip to main content

For this part of the course, you will complete small projects writing computer programs (code) in Python. You can read more about Python as a programming language here and here. You will not need to download Python to your computer, instead you will be using an online educational tool called Codecademy.

Why programming?
Computer science is an important component of cognitive science. These assignments will serve as an introduction to the intricacies of programming. It will also provide first hand experience with symbol systems, algorithms, conditionals and functions.

What if you have never programmed before?
Don’t worry! This series of exercises will start at a very basic level. The program will guide you through each new task step-by-step. Because you will be working directly with the online Codecademy program, you will not need to download or install any programs.

Codecademy: Getting started


  • Go to Codecademy.com (read more about Codecademy here)
  • Click the ‘Sign Up’ button and follow the instructions to create an account.
  • Click on ‘Catalog’ in the top bar.
  • Click on ‘Learn Python’ (find it quickly by selecting the ‘Languages’ tab).
  • Click ‘Start’ and start programming!
  • When you sign back in later, you can see your progress by choosing the ‘Learn’ tab in the upper right corner.

Notes about completing Codecademy modules

  • These assignments start out very simple, but get more complicated after the first few modules. Make sure you budget enough time to complete assignments 2 and 3.
  • In most cases, the program will not let you progress unless your code is correct. However, this is not always the case. You can use Codecademy Labs to test whether your program really works, and also to play with your code outside of the specific assignments.
  • If you are stuck, try the Q&A forum (bottom left in each module). Other people may have had the same problem before you!

Submitting Programming Assignments


The final exercise of each module will generally give you practice on all the code-writing principles and syntax you learned in the earlier exercises. As an indicator that you successfully completed all the exercises within the modules and produced the correct output from your code, you will need to submit your code for the final exercise of each module as a text file (i.e., a .txt file — not a .doc, or .docx, or .pdf file) under Assignments through Sakai. There is a template that you should use, fill in with your code, and edit for the future assignments under the Resources folder on Sakai called “programminghw_template.txt“. Assignments should be saved as “ProgrammingHW[num]_LastName”, where [num] stands for the number of that programming assignment.

General Notes About Coding


  • Good codes do what they are supposed to do, but better codes would make future-you thank current-you for clearly showing what your code does and how it does what it does (realize that past-you never responds to emails!). As with communicating using natural language, writing code that is clear and informative promotes effective communication in programming languages between collaborators (in this case, you with yourself and you with your professors). In starting out to learn and write code, it is important to build habits that promote clean and polite code-writing behavior. There are several ways you can develop this habit — give your variables informative names, comment regularly about what succeeding bodies of code do, indent code consistently, identify when it was last edited and what the last edits were, etc. As an exercise, examine the template provided for you to fill in for these programming assignments — do you notice what would make it easy for future-you and us to read it? Can you make it better? You can also extend some of these actions to your file management practices. (e.g., Why should the assignment be saved with the filename specified earlier?)
  • As with learning natural languages, you learn how to use a programming language most by practicing what you learn and not by memorizing the syntax. Do not worry/be embarrassed if the particular command you just learned (or supposed to have learned a long time ago) escapes you — Google is your friend! Even great programmers search for “mundane” commands on Google!

Assignments


Codecademy Assignment 1

Complete the following modules:

After completing the four modules, copy-paste your code in the final exercise into the template text (.txt) file. Make sure that the indentation is copied properly! Submit the text file through Sakai under Assignments.


Codecademy Assignment 2

Complete the following modules:

After completing the modules, copy-paste your code in the final exercise into the template text (.txt) file. Make sure that the indentation is copied properly! Submit the text file through Sakai under Assignments.


Codecademy Assignment 3

Complete the following modules:

After completing the modules, copy-paste your code in the final exercise into the template text (.txt) file. Make sure that the indentation is copied properly! Submit the text file through Sakai under Assignments.