Introduction to Computational Thinking in Python

By Felix Muzny

What are these notes?

This set of notes is meant to supplement lecture and lab materials. They are not intended to be sufficient standalone material to master python or the other concepts covered in class.

These notes are a great place to review concepts that we’ve been over in class and to play around with code. The examples that are given in these notes are great places to start if you are confused about a topic or would like to discuss how a specific example of code works.

Working with these notes

In these notes you’ll see code in three different ways:

  1. Non-interactive: embedded in text inline like print("hello").
  2. Non-interactive: embedded in it’s own code block.
    print("ahoy")
    
  3. Interactive: in a editable, runnable block. (Notice that there is both a “interactive mode” and a “copy” icon in the upper right of this block. This makes it easy for you to copy+paste this code into a Jupyter Notebook on your computer.)
# TODO: run this cell by clicking "interactive mode", 
# then clicking the "run" button
print("greetings")

Acknowledgements

These notes have taken much inspiration from the interactive textbook How to Think Like a Computer Scientist by Brad Miller and David Ranum.

These notes use the Jupyter Books package which was originally created by Sam Lau and Chris Holdgraf with support of the UC Berkeley Data Science Education Program and the Berkeley Institute for Data Science.

Licensing

These notes are licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).