Skip to content

Commit cfacf26

Browse files
most of week 2 presentation, and template for other weeks
1 parent 6f68a73 commit cfacf26

12 files changed

Lines changed: 1165 additions & 10 deletions

‎Syllabus.rst‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,29 @@ Finding and using the documentation. Getting help. Class github project. Basic d
148148
Week 2: Oct 8
149149
................
150150

151-
More on functions: definition and use; arguments; block structure; scope.
151+
More on functions: definition and use, arguments, block structure, scope, recursion.
152+
152153
Modules and import.
153-
Boolean expressions. Conditionals and control flow. Iteration and recursion.
154+
155+
Boolean expressions.
156+
157+
Conditionals
158+
159+
Sequences: Strings, Tuples, Lists
154160

155161

156162
Week 3: Oct 15
157163
.................
158164

159-
Data types. Sequences. Strings. Tuples, Lists, Dictionaries. Mutability.
165+
Looping and control flow.
166+
167+
Data types, Dictionaries. Mutability.
168+
169+
Iteration
170+
160171
Files. Exceptions. Text Processing. Unicode.
161172

173+
162174
Week 4: Oct 22
163175
................
164176

@@ -169,7 +181,9 @@ Argument passing. List comprehensions. Regular expressions.
169181
Week 5: Oct 29
170182
........................
171183

172-
Testing, omprehensions again. More data types: Sets, Arrays. Functional programming, lambda, and callables
184+
Testing, Comprehensions again. More data types: Sets, Arrays.
185+
186+
Functional programming, lambda, and callables
173187

174188

175189
Week 6: November 5

‎week-01/code/students.txt‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name languages
2-
Barker, Chris Python C C++ Shell Fortran Pascal
3-
Rakita, Joshua C# Java Python JavaScript
1+
name: languages
2+
Barker, Chris: Python, C, C++, Shell, Fortran, Pascal
3+
Rakita, Joshua: C#, Java, Python, JavaScript
44
Antoun, Jo-Anne: python (GIS)
5-
AuBuchon, Harlan: py (java)
5+
AuBuchon, Harlan: python, java
66
Bae, Andrew: pascal, C, C#
77
Chan, Lawrence: VB
88
Chhen, Rithy: PHP, java, JS, SQL
@@ -28,8 +28,8 @@ Savage, Nathan: py3, PHP,
2828
Schmitz, Brian: javascript, PHP
2929
Small, Edward (Ryan): python, JS
3030
Smith, Richard: C++, Java, XML, Shell
31-
Thach, Phuc: all of them: php, JS
31+
Thach, Phuc: php, JS
3232
Tran, Linh: html, java
3333
Warren, Catherine: SQL
3434
Werner, Steven: javascript
35-
Wright, Duane
35+
Wright, Duane:

‎week-02/code/fib_solution.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#/usr/bin/env python
2+
3+
def fib(n):
4+
"""
5+
recursive function that computes Fibonacci numbers
6+
"""
7+
if n == 0:
8+
return 0
9+
elif n == 1:
10+
return 1
11+
else:
12+
return fib(n-1) + fib(n-2)
13+
14+
15+
print fib(0),
16+
print fib(1),
17+
print fib(2),
18+
print fib(3),
19+
print fib(4),
20+
print fib(5),
21+
print fib(6),
22+
print fib(7),
23+
24+

‎week-02/code/list_lab.rst‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
List Lab
3+
#############
4+
5+
Modeled after <http://www.upriss.org.uk/python/session5.html>
6+
7+
8+
Examples
9+
===================
10+
zoo = ["giraffe", "crow"] # define a list
11+
zoo[0] # a single element
12+
zoo[0] = "zebra" # change an element
13+
zoo.append("marmot") # add element at end of list
14+
zoo = ["cat"] + zoo # add element at beginning
15+
type(raw_input("Type a string: ")) # returns str
16+
type( input("Type a number: ")) # returns int or float
17+
[x for x in zoo if len(x) > 4] # list comprehension
18+
zoo2 = zoo[:] # create a list copy
19+
zoo.pop() # delete last element
20+
del zoo[0] # delete element by index
21+
zoo.remove('crow') # delete element by value
22+
"abc"[::-1] # reverse a string: "cba"
23+
# Unspecified range takes all; step value of -1 reverses.
24+
Exercises
25+
===============
26+
27+
1.
28+
- Create a list that contains "Apples", "Pears", "Oranges" and "Peaches".
29+
- Display the list.
30+
- Ask the user for another fruit and add it to the end of the list.
31+
- Display the list.
32+
- Ask the user for a number and display the number back to the user and the fruit corresponding to that number (on a 1-is-first basis).
33+
- Add another fruit to the beginning of the list using "+" and display the list.
34+
- Add another fruit to the beginning of the list using insert() and display the list.
35+
36+
- Display all the fruits that begin with "P", using a for loop and then using a list comprehension.
37+
38+
2. Using the list above:
39+
- Display the list.
40+
- Remove the last fruit from the list.
41+
- Display the list.
42+
- Ask the user for a fruit to delete and find it and delete it.
43+
- (Bonus: Multiply the list times two. Keep asking until a match is found. Once found, delete all occurrences.)
44+
45+
3. Using the list in item 1:
46+
- Ask the user for input displaying a line like "Do you like apples?"
47+
- for each fruit in the list (making the fruit all lowercase).
48+
- For each "no", delete that fruit from the list.
49+
- Display the list.
50+
51+
4. Using the list in item 1:
52+
- Make a copy of the list and reverse the letters in each fruit in the copy.
53+
- Delete the last item of the original list. Display the original list and the copy.

‎week-03/presentation-week03.tex‎

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
\documentclass{beamer}
2+
%\usepackage[latin1]{inputenc}
3+
\usetheme{Warsaw}
4+
\title[Intro to Python: Week 1]{Introduction to Python\\ Topics}
5+
\author{Christopher Barker}
6+
\institute{UW Continuing Education}
7+
\date{October 15, 2013}
8+
9+
\usepackage{listings}
10+
\usepackage{hyperref}
11+
12+
\begin{document}
13+
14+
% ---------------------------------------------
15+
\begin{frame}
16+
\titlepage
17+
\end{frame}
18+
19+
% ---------------------------------------------
20+
\begin{frame}
21+
\frametitle{Table of Contents}
22+
%\tableofcontents[currentsection]
23+
\tableofcontents
24+
\end{frame}
25+
26+
27+
\section{Review/Questions}
28+
29+
% ---------------------------------------------
30+
\begin{frame}{Review of Previous Class}
31+
32+
\begin{itemize}
33+
\item .
34+
\item .
35+
\item .
36+
\end{itemize}
37+
38+
\end{frame}
39+
40+
41+
% ---------------------------------------------
42+
\begin{frame}{Lightning Talks}
43+
44+
\vfill
45+
{\LARGE Lightning talks today:}
46+
47+
\vfill
48+
{\Large
49+
50+
51+
\vfill
52+
53+
\vfill
54+
55+
\vfill
56+
57+
}
58+
\vfill
59+
60+
\end{frame}
61+
62+
63+
% ---------------------------------------------
64+
\begin{frame}{Homework review}
65+
66+
\vfill
67+
{\Large Homework Questions? }
68+
69+
\vfill
70+
{\Large My Solution}
71+
72+
\vfill
73+
74+
\end{frame}
75+
76+
%########################
77+
\section{First Section}
78+
79+
\begin{frame}[fragile]{topic}
80+
81+
{\Large Some Stuff}
82+
83+
\begin{verbatim}
84+
sample code
85+
\end{verbatim}
86+
87+
88+
\end{frame}
89+
90+
91+
%-------------------------------
92+
\begin{frame}{LAB}
93+
94+
\vfill
95+
{\large Some lab excercises}
96+
\vfill
97+
98+
\end{frame}
99+
100+
101+
%-------------------------------
102+
\begin{frame}{Lightning Talk}
103+
104+
{\LARGE Lightning Talks:}
105+
106+
\vfill
107+
{\large person 1}
108+
109+
\vfill
110+
{\large person 2}
111+
112+
\end{frame}
113+
114+
115+
%-------------------------------
116+
\begin{frame}[fragile]{Homework}
117+
118+
Recommended Reading:
119+
\begin{itemize}
120+
\item some stuff
121+
\end{itemize}
122+
123+
Do:
124+
\begin{itemize}
125+
\item Some things
126+
\end{itemize}
127+
128+
\end{frame}
129+
130+
131+
\end{document}
132+
133+

0 commit comments

Comments
 (0)