Skip links
Week 4
Prepare
Read
Submit
Submit a .py file with your best attempt at the exercise Chess Dictionary Validator
near the end of the textbook chapter in 1.5. NOTE: only found in the online version of the textbook.
Review
How to submit a question on Slack
How to find and run last week’s notebook’s
How to make/submit a .py file in Atom
Lecture - History of Computation
Importing Modules, os
/sys
Functions
Defining functions, arguments, and keyword arguments
Returning values
Scope, local and global
Handling Exceptions
Storing Data
Lists
Why use lists, order series (flat data)
Creating a list, populated, blank
Looping a list with for
.append()
, remove()
, and delete()
lists
Checking for subsets with in
and not in
Splicing lists
Dictionaries
Why use dictionaries, unordered depth (nested data)
Looping
key, val
.keys()
, .values(),
.items()`
.pop()
, delete()
pretty printing with pprint.pprint()
Checking if value is in
Functions
Using functions
Making your own function
Accepting argument(s)
Returning values
Scope
Class Exercise: Wikipedia Module
Having it search one term and auto download
Having it make a function that returns data for all terms