WSU logo School of Electrical Engineering and Computer Science,
		Washington State University

CptS 111:  Introduction to Computer Programming

Home
Schedule Syllabus
Programming
  Assignments

Labs
Exams

Student Care
WSU Alerts
WSU Safety Plan
WSU Emergency
  Management

Academic
  Calendar

myWSU
Facebook
Canvas

Class Schedule

Week Date Reading Lecture Notes Topics
1 M-1/9 Ch. 1
Introduction
Jupyter,
Slides
Jupyter Notebook; how to succeed in CptS 111; computer programs (code, scripts, apps); transistors and binary; bits and bytes; computer programming languages: compiled vs interpreted; IDEs; stdin, stdout; simple input and output: input(), print()
W-1/11 Ch. 2
Variables & Expressions,
Modules, and Math
Jupyter,
Slides
more on input() and print(); type(); int(); float(); whitespace, including newline character (\n) and tab character (\t); expression vs statement or command; variables vs literals; lvalues (values to the LEFT of assignment operators; assignment operator (=); rules for names; reserved words; naming conventions: camel case vs using underscores; floats vs integers (integers are more precise!)
2 M-1/16
MLK Jr. Day
W-1/18 Ch. 2 Jupyter,
Slides
augmented assignment (compound operators), e.g., +=, *=; math operators; precedence of math operations; more on print(); a little on f-string string formatting, e.g., printing a float with two decimal places; division (/) vs floor division (//); modulo operator (%); divmod(); modules: standard modules, e.g., math, random, os; import; dot notation; using an alias when importing a module
3 M-1/23 Ch. 3
Data Types and Data Structures
Jupyter,
Slides
dot notation with modules; string indexing including negative indexing, e.g., [-1] for the last character in a string; string immutability; len() function; operator overloading: repetition (*) and concatenation (+); use of quotes and the escape character (\); initiating empty strings; combining operator overloading and augmented assignment with characters; ASCII characters: printable and unprintable; ASCII and extended Unicode; chr() and ord() functions
W-1/25 Pair programming Slides Pair programming in zyBooks, PA #1 (zyLab_PA1, due 2.3.23)
4 M-1/30 Ch. 3 Jupyter,
Slides
review of input() function; more on using str(), float(), and int(); can't use int() with a string float!; string formatting using f-strings: format string and replacement fields; format specifiers: width, alignment, fill and padding, maximum width and precision, type and precision
W-2/1 Ch. 3 Jupyter,
Slides
data structures; containers; iterables; sequences; mutability; lists; functions vs methods; initializing an empty list; combining lists using operator overloading; indexing lists; some list functions: sum(), len(), max(), min(); some list methods: .append(), .count(), .pop(), .remove(), .sort(); tuples; some tuple functions and methods: max(), len(), sum(), .count(), i.e., any list function or method that doesn't involve changing a tuple; combining tuples using operator overloading; dictionaries; initializing an empty dictionary; key-value pairs; adding or modifying values using keys; del; .clear(); in
5 M-2/6 Ch. 4
Conditionals
Jupyter,
Slides
conditionals: if statements, test expressions, if-else construct, multiple if statements, if-elif-else construct; Boolean variables: True, False; comparison/relational operators: >, >=, ==, <, <=, !=; false objects in Python: False, 0, None, any empty object, e.g., empty list, empty tuple, empty string
W-2/8 Ch. 4 Jupyter,
Slides
comparison/logical operator redux: use with floats, use with integers, use with strings, use with lists; Boolean/logical operators (listed in order of precedence): not, and, or; Boolean expressions including operator chaining; nested conditionals; precedence: math > comparison/relational > Boolean/logical
6 M-2/13 Ch. 5
Functions
Jupyter,
Slides
functions: built-in vs user-defined; function calls; def; return; void functions; parameters vs arguments; keyword arguments (kwargs); default (parameter) values
W-2/15
Exam #1
Ch. 1 - Ch. 4
7 M-2/20
Presidents' Day
W-2/22 Ch. 5 Jupyter,
Slides
function flow: function call to function and back to program or function that called the function (at the statement where the function was called); program order: "upside-down" programming; non-void functions: when lvalues are needed, use in print() statements, use in math expressions; nested functions; reasons for using functions; docstrings and the help() function
8 M-2/27 Ch. 5 Jupyter,
Slides
use of the main() function; calling main(); function stubs: e.g., pass; incremental development of programs using function stubs; errors: syntax, run-time, logic, function; using print() to help with coding
W-3/1 Ch. 5 Jupyter,
Slides
scope; namespaces; scope resolution; namespaces: local (inside function), global (outside function), builtin (e.g., print(), int()) (everywhere); scope resolution search order, i.e., how Python finds a name: local namespace, global namespace, builtin namespace (in that order); passing lists as arguments to void functions; global command
9 M-3/6 Ch. 6
Loops
Jupyter,
Slides
inefficiency of repeating commands; introduction to loops; for-loops; range() function; counting for-loops; special case of counting for-loops
W-3/8 Ch. 6 Jupyter,
Slides
iterating for-loops; iterating vs counting for-loops: when you have to use a counting for-loop; while-loops; break; continue
SPRING BREAK !!!
10 M-3/20 Ch. 6 Jupyter,
Slides
creating itemized lists using counting and iterating for-loops; using enumerate() with iterating for-loops to create itemized lists; review of data structures including dictionaries; using dictionaries in iterating for-loops; using view objects in iterating for-loop headers: .items(), .keys(), .values(); using zip() to zip together two lists and to create a dictionary
W-3/22 Ch. 6 Jupyter,
Slides
for-loops vs while-loops; nested for-loops; lists of lists (nested lists); indexing nested lists; readable code, including using multiple lines to write nested lists, i.e., formatting nested lists as tables; outer loop associated with rows, inner loop associated with columns
11 M-3/27 Ch. 7
Files and More on Modules
Jupyter,
Slides
a little on os module; opening files: open(); closing files: .close(); .tell(); reading from file: .read(), .readlines(), .readline(); using file (wrapper) as iterable in for-loop header; writing to file: .write(); printing to file: print(whatever_printable, file=name_of_file(_wrapper))
W-3/29 Ch. 7 Jupyter,
Slides,
random_walk.py
with command; importing modules: import module_name, import module_name as module_alias, from module_name import func1, func2, func3,..., from module_name import *, from module_name import func1 as func1_alias, func2 as func2_alias,...; import user-written modules
12 M-4/3 Ch. 8
More on Strings
Jupyter,
Slides
eval(); string formatting: modulo-formatting, .format() method formatting; string methods: .capitalize(), .title(), .swapcase(), .upper(), .lower(), .count(), .find(), .replace(), .lstrip(), .rstrip(), .strip(); chaining methods (left to right)
W-4/5
Exam #2
Ch. 5 - Ch. 7
13 M-4/10 Ch. 8 Jupyter,
Slides
string methods: .split(), .join(); use of in with strings; string slicing [start:stop:increment]
W-4/12 Ch. 9
More on Lists
and Dictionaries
Jupyter,
Slides
more list methods: .insert(), .extend(), .sort() redux, .reverse(); another list function: sorted(); void method .sort() vs non-void function sorted(); using kwargs with .sort() and sorted(): reverse=True, key=str.lower; simultaneous assignment with lists and loops; list slicing; deep copy [ : ]; modifying lists in loops using a deep copy
14 M-4/17 Ch. 9 Jupyter,
Slides
the in command with lists; more on tuples; more dictionary methods: .get(), .update(), .pop(); operator overloading and dictionaries; a summary of what we know about dictionaries; nested dictionaries
W-4/19 Ch. 10
Plotting
Jupyter,
Slides
plotting: matplotlib.pyplot module (plt): plot(), show(), axis(), string formats for lines, keywords for lines, xlabel(), ylabel(), title(), legend(); using math text in labels, titles, and legends
15 M-4/24 Ch. 10 Jupyter,
Slides
plotting data from files; numpy module (np): array(), exp(), arange(); using math operations (**, *, +, -) with arrays; using arrays as arguments for plot(); creating subplots with matplotlib.pyplot
W-4/26 Wrap-up Slides
16 Tu-5/2
Final Exam
(1:30 - 3:30 pm, Spark 339)
Comprehensive