Learn and practice some Python fundamentals. We're assuming some comfort with these basics next class, so don't skimp on the Python learning!
Work through the Python Syntax Crash Course if you were absent or if we didn't complete it during class.
Read and work through Chapters 0-2 in Automate the Boring Stuff (2nd Edition), along with the other resources specified below.
NOTE: You don't have to do the exercises in Automate the Boring Stuff, but you should type in the commands for code examples throughout the text.
Ignore the book's instructions on where to write code. Instead, you should use our Data Journalism Notebooks site and just create a new notebook to experiment in. Some additional options that we'll cover in class include: (1) the standard
python
interactive shell on the command-line; (2) a text editor such as VS Code, which provides a built-in command line shell for running Python scripts (aka files containing Python code with.py
extension); (3) a GitHub Codespace, which provides a full development environment in the cloud that lets you code in Python and run the files.
- Chapter 0 - Introduction - Read from top through Programming is a Creative Activity
- Chapter 1 - Python Basics - Work through the whole chapter. For Your First Program, use VS Code or another code editor to create
hello.py
. Then run it on the command line by executingpython hello.py
. - Chapter 2 - Flow Control - Read through Flow Control Statements - Elif Statements (stop just before while Loop Statements)
- "for" loops (W3C) - Read and work through all sections
Work through the Code Challenge at the end of the Python Syntax Crash Course. You can use the Data Journalism Notebook site to complete your work, but please make sure to start a fresh notebook called filter_animals.ipynb
.
It's important that you start a new notebook for this assignment and do not include unrelated code from class exercises. The notebook should only contain the code required to complete the challenge -- no other extraneous or unrelated code. Submissions that contain unrelated code will lose points.
Once you've completed the Code Challenge on the Data Journalism Notebook site, you should download and submit a copy of the notebook via Canvas. You can do this by:
- Navigating to the left-hand panel
- Right clicking on your file name and clicking download.
Here's a screenshot of what the interface looks like: